/* ============================================================
   Tienda Nutrimed · Portal catálogo
   ============================================================ */

:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --secondary:     #10b981;
  --warning:       #f59e0b;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg:            #f8fafc;
  --card:          #ffffff;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius:        12px;
  --radius-sm:     8px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ─────────────────────────────────────────── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.15rem;
}

.hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: .5rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}

/* ── Carrusel de publicidad ──────────────────────────── */
.carousel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 16 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--card);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: block;
  background-size: cover;
  background-position: center;
  opacity: 0;
  z-index: 0;
  transition: opacity .6s ease;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-dots {
  position: absolute;
  bottom: .75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
  z-index: 2;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: none;
  padding: 0;
  cursor: pointer;
}

.carousel-dots .dot.active { background: #fff; }

@media (max-width: 600px) {
  .carousel { aspect-ratio: 16 / 8; }
}

/* ── Navegación de categorías (anclas) ──────────────── */
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  padding: 1rem 0 2rem;
}

.cat-nav a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, color .15s, border-color .15s;
}

.cat-nav a:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ── Secciones de categoría ─────────────────────────── */
.categoria {
  padding: 2rem 0;
  scroll-margin-top: 80px;
}

.categoria-header {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: 1.25rem;
}

.categoria-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.categoria-header .count {
  color: var(--text-muted);
  font-size: .9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* ── Tarjeta de producto ─────────────────────────────── */
.card-producto {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
}

.card-producto:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-producto .thumb {
  height: 140px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--primary);
  overflow: hidden;
}

.card-producto .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-producto .body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
}

.card-producto .titulo {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

.card-producto .desc {
  color: var(--text-muted);
  font-size: .85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-producto .footer-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .5rem;
}

.precio {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 1.05rem;
}

.btn-ver {
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── Tarjeta destacada (categoría de acceso único) ──── */
.card-destacada {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  text-decoration: none;
  transition: transform .15s;
}

.card-destacada:hover { transform: translateY(-3px); }

.card-destacada .icono { font-size: 2.2rem; }

.card-destacada h3 { font-size: 1.15rem; font-weight: 800; }

.card-destacada p {
  color: rgba(255,255,255,.9);
  font-size: .9rem;
  line-height: 1.4;
}

.card-destacada .btn-ver {
  color: #fff;
  margin-top: .3rem;
}

/* ── Estado vacío ────────────────────────────────────── */
.vacio {
  color: var(--text-muted);
  font-size: .9rem;
  padding: 1.5rem;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  padding: 2.5rem 0;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}
