/* ──────────────── Base ──────────────── */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --bg: #f8fafc;
  --card-radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 { letter-spacing: -0.02em; }

/* ──────────────── Navbar ──────────────── */
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.35rem;
}
.navbar-brand span { color: #a5b4fc; }

.navbar .badge {
  font-weight: 500;
  font-size: .7rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ──────────────── Cards de producto ──────────────── */
.product-card {
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-card .ratio { background: #f1f5f9; }
.product-card .ratio img {
  transition: transform .4s ease;
}
.product-card:hover .ratio img {
  transform: scale(1.04);
}
.product-card .card-body {
  padding: 1rem 1rem 1.1rem;
}
.product-card .card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .15rem;
  line-height: 1.3;
}
.product-card .seller-name {
  font-size: .78rem;
  color: var(--ink-soft);
  margin-bottom: .5rem;
  display: block;
}
.product-card .price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

/* ──────────────── Hero ──────────────── */
.hero-dynamic {
  min-height: 62vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  position: relative;
}
.hero-dynamic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.15) 0%, rgba(15,23,42,.55) 100%);
  pointer-events: none;
}
.hero-dynamic > .container {
  position: relative;
  z-index: 1;
}
.hero-dynamic h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero-dynamic p.lead {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  opacity: .92;
  max-width: 640px;
}
@media (max-width: 768px) {
  .hero-dynamic { min-height: 48vh; }
}

/* ──────────────── Slider destacados ──────────────── */
.slider { position: relative; }
.slider-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: .5rem;
  scrollbar-width: none;
}
.slider-track::-webkit-scrollbar { display: none; }
.slider-card {
  flex: 0 0 85%;
  scroll-snap-align: start;
}
@media (min-width: 576px) { .slider-card { flex-basis: 48%; } }
@media (min-width: 992px) { .slider-card { flex-basis: 25%; } }

.slider-btn {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: var(--shadow-md);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.slider-btn:hover { box-shadow: var(--shadow-lg); transform: translateY(-50%) scale(1.05); }
.slider-prev { left: -10px; }
.slider-next { right: -10px; }
@media (max-width: 575px) {
  .slider-btn { display: none; }
}

/* ──────────────── Formularios ──────────────── */
.form-label { font-weight: 500; font-size: .9rem; color: var(--ink); }
.form-control, .form-select {
  border-radius: 10px;
  border-color: #e2e8f0;
  padding: .6rem .8rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  border-radius: 10px;
  font-weight: 500;
  padding: .55rem 1.1rem;
  transition: background .15s ease, transform .05s ease;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:active { transform: scale(.98); }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger, .btn-outline-success, .btn-outline-warning, .btn-outline-info, .btn-outline-light, .btn-outline-dark {
  border-radius: 10px;
  font-weight: 500;
  padding: .45rem .9rem;
}
.btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }

/* ──────────────── Alerts como toasts ──────────────── */
.toast-container .toast {
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: none;
}

/* ──────────────── Tablas ──────────────── */
.table thead th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
}
.table tbody tr:hover { background: #f8fafc; }

/* ──────────────── Cards genéricas ──────────────── */
.card {
  border-radius: var(--card-radius);
  border: 1px solid rgba(15, 23, 42, .05);
}
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }

/* ──────────────── Descripción de producto ──────────────── */
.product-description {
  line-height: 1.65;
  color: var(--ink-soft);
}
.product-description h2,
.product-description h3 {
  color: var(--ink);
  margin-top: 1.2em;
  margin-bottom: .5em;
}
.product-description ul,
.product-description ol {
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.product-description ul { list-style: disc; }
.product-description ol { list-style: decimal; }
.product-description ul li,
.product-description ol li {
  margin-bottom: .3em;
}

/* ──────────────── Login ──────────────── */
.auth-wrapper {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.25rem;
}

/* ──────────────── Gallery thumbs ──────────────── */
.gallery-thumb .btn { opacity: .9; }
.gallery-thumb .btn:hover { opacity: 1; }

/* ──────────────── Footer ──────────────── */
footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  margin-top: 3rem;
}