/**
 * TuttyCosas Kids — layout.css
 * Navbar · Hero · Grid · Categorías · Footer · Responsive
 * Sprint 2 — Arquitectura modular
 */

/* ── NAVBAR ── */
.navbar {
  background: rgba(250,247,242,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cream-deep);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1240px; margin: 0 auto;
  padding: 0 28px; height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 700;
  color: var(--sage-dark); display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.logo-leaf { display: inline-block; font-size: 1.2rem; animation: leafSway 4s ease-in-out infinite; }
.logo em   { font-style: italic; color: var(--terra); }

.nav-search { flex: 1; max-width: 360px; position: relative; }
.nav-search input {
  width: 100%; padding: 9px 16px 9px 38px;
  border: 1.5px solid var(--cream-deep); border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 0.88rem;
  background: var(--cream-dark); color: var(--bark);
  outline: none; transition: all 0.2s;
}
.nav-search input:focus { border-color: var(--sage); background: var(--white); }
.nav-search input::placeholder { color: var(--stone); }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--stone); pointer-events: none; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-cart {
  background: var(--sage); color: var(--white);
  padding: 9px 18px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.85rem;
  display: flex; align-items: center; gap: 7px;
  transition: all 0.25s var(--ease-out);
}
.btn-cart:hover { background: var(--sage-dark); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.cart-badge {
  background: var(--terra); color: var(--white);
  border-radius: 50%; width: 19px; height: 19px;
  font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── NAV CATEGORÍAS ── */
.nav-cats { border-bottom: 1px solid var(--cream-deep); background: var(--cream); }
.nav-cats-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 28px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.nav-cats-inner::-webkit-scrollbar { display: none; }
.nav-cat-link {
  padding: 11px 18px; font-size: 0.83rem; font-weight: 500;
  color: var(--stone); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.nav-cat-link:hover { color: var(--sage); }
.nav-cat-link.active { color: var(--sage-dark); border-bottom-color: var(--sage); font-weight: 600; }

/* ── HERO ── */
.hero {
  background: var(--cream-dark); min-height: 520px;
  display: grid; grid-template-columns: 1fr 1.1fr; overflow: hidden;
}
/* El slider ocupa la columna visual — misma posición que hero-visual */
.hero > .hero-slider {
  position: relative;
  overflow: hidden;
  min-height: 520px;
}
.hero-content {
  padding: 72px 56px 72px 48px;
  display: flex; flex-direction: column; justify-content: center; position: relative;
}
.hero-content::after {
  content: ''; position: absolute; top: 40px; left: 40px;
  width: 120px; height: 120px;
  border: 1.5px solid var(--cream-deep); border-radius: 50%; opacity: 0.6;
}
.hero-eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--sage);
  margin-bottom: 18px; display: flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before { content: ''; display: block; width: 28px; height: 1.5px; background: var(--sage); }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.2rem,4vw,3.4rem);
  font-weight: 700; line-height: 1.12; color: var(--bark); margin-bottom: 20px;
}
.hero h1 em   { font-style: italic; color: var(--sage); }
.hero h1 span { color: var(--terra); }
.hero-desc {
  font-size: 1rem; color: var(--bark-mid); line-height: 1.75;
  font-weight: 400; max-width: 380px; margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-trust-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.trust-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--white); padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 500; color: var(--bark-mid);
  box-shadow: var(--shadow-xs);
}
.hero-visual {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--sage-pale) 0%, var(--cream-deep) 100%);
  display: flex; align-items: center; justify-content: center;
}
.hero-badge {
  position: absolute; background: var(--white); border-radius: var(--radius-lg);
  padding: 10px 16px; box-shadow: var(--shadow-md);
  font-size: 0.78rem; font-weight: 600; color: var(--bark);
  display: flex; align-items: center; gap: 6px;
  animation: float 4s ease-in-out infinite;
}
.hero-badge-1 { top: 24%; left: 8%; animation-delay: 0s; }
.hero-badge-2 { bottom: 28%; right: 6%; animation-delay: 1.5s; }
.hero-badge .badge-icon { font-size: 1.1rem; }

/* ── CATEGORÍAS ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}
.cat-grid .cat-card:first-child { grid-row: span 2; }
.cat-card {
  border-radius: var(--radius-lg); overflow: hidden;
  position: relative; cursor: pointer;
  transition: all 0.35s var(--ease-out); aspect-ratio: 1;
}
.cat-card:first-child { aspect-ratio: auto; }
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-out); }
.cat-card:hover img { transform: scale(1.07); }
.cat-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(44,36,22,0.65) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.cat-name  { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--white); }
.cat-count { font-size: 0.72rem; color: rgba(250,247,242,0.75); margin-top: 2px; }

/* ── PRODUCTOS GRID ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.recos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ── PROMO BANNER ── */
.promo-banner { background: var(--sage-dark); padding: 48px 28px; }
.promo-inner  { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.promo-eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--sage-light); margin-bottom: 8px; }
.promo-title { font-family: var(--font-display); font-size: clamp(1.6rem,3vw,2.2rem); font-weight: 700; color: var(--cream); margin-bottom: 10px; }
.promo-title em { font-style: italic; color: #C8E6CA; }
.promo-desc { color: rgba(250,247,242,0.7); font-size: 0.9rem; line-height: 1.6; }
.promo-cta  { flex-shrink: 0; }
.btn-promo {
  background: var(--cream); color: var(--sage-dark);
  padding: 14px 28px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 0.9rem; border: none; cursor: pointer;
  transition: all 0.25s var(--ease-out); white-space: nowrap;
}
.btn-promo:hover { background: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── FOOTER ── */
footer { background: var(--bark); color: rgba(250,247,242,0.6); padding: 56px 28px 28px; }
.footer-inner { max-width: 1240px; margin: 0 auto; }
.footer-grid  { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .logo { color: var(--cream); margin-bottom: 14px; }
.footer-brand .logo em { color: var(--terra-light); }
.footer-brand p { font-size: 0.85rem; line-height: 1.75; }
.footer-socials { display: flex; gap: 8px; margin-top: 18px; }
.social-btn {
  width: 36px; height: 36px;
  background: rgba(250,247,242,0.08); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; transition: all 0.25s; cursor: pointer;
}
.social-btn:hover { background: var(--sage); transform: translateY(-3px); }
.footer-col h4  { color: var(--cream); font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; margin-bottom: 18px; }
.footer-col li  { margin-bottom: 9px; }
.footer-col a   { font-size: 0.83rem; color: rgba(250,247,242,0.55); transition: color 0.2s; font-weight: 400; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid rgba(250,247,242,0.1);
  padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 0.78rem;
}
.payment-icons { display: flex; gap: 7px; }
.payment-icon  { background: rgba(250,247,242,0.08); border-radius: 5px; padding: 4px 10px; font-size: 0.7rem; color: rgba(250,247,242,0.6); font-weight: 600; letter-spacing: 0.5px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .cat-grid .cat-card:first-child { grid-row: auto; }
  .trust-bar-inner { grid-template-columns: repeat(2,1fr); }
}
/* ── HERO SLIDER — sizing por breakpoint ── */
.hero-slider {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 520px;
}
.hero-slider-track { position: relative; width: 100%; height: 100%; }
.hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Flechas — visibles al hover en desktop, ocultas en mobile */
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.85); border: none; border-radius: 50%;
  width: 40px; height: 40px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #3a3a3a; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  opacity: 0; transition: opacity .2s; z-index: 10;
}
.hero-slider:hover .hero-arrow { opacity: 1; }
.hero-arrow-prev { left: 12px; }
.hero-arrow-next { right: 12px; }

/* Dots */
.hero-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.5); border: none; cursor: pointer;
  padding: 0; transition: background .2s, transform .2s;
}
.hero-dot-active { background: #fff; transform: scale(1.3); }

@media (max-width: 640px) {
  .hero-arrow { display: none !important; } /* swipe táctil en mobile */
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .hero-visual   { display: none; }
  .hero-content  { padding: 40px 24px 32px; order: 2; }
  .hero > .hero-slider { min-height: 240px; width: 100%; order: 1; }
  .hero-slider   { min-height: 240px; }
}

@media (max-width: 640px) {
  .hero-content  { padding: 28px 20px 24px; order: 2; }
  .hero > .hero-slider { min-height: 220px; order: 1; }
  .hero-slider   { min-height: 220px; }
  .trust-bar-inner { grid-template-columns: repeat(2,1fr); }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
  .testimonios-grid { grid-template-columns: 1fr; }
  .modal-inner   { grid-template-columns: 1fr; }
  .modal-img-col { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-img     { min-height: 220px; }
  .promo-inner   { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 640px) {
  .nav-inner   { padding: 0 16px; height: 62px; }
  .nav-search  { display: none; }
  .hero-content { padding: 40px 20px; }
  .cat-grid    { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .section     { padding: 48px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .trust-bar-inner { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 400px) {
  .hero-actions  { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR — mobile only — Sprint 3f
   ═══════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  /* Espacio para que el contenido no quede tapado por el nav */
  body { padding-bottom: 64px; }

  /* FAB de WA y chat suben sobre el bottom nav — lados opuestos */
  .wa-fab      { bottom: 76px; right: auto; left: 16px; }
  .chat-fab    { bottom: 76px; right: 16px; }
  .chat-window { bottom: 76px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(250,247,242,0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--cream-deep);
    z-index: 200;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 6px 2px;
    color: var(--stone);
    font-size: 0.60rem;
    font-weight: 500;
    font-family: var(--font-body);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item.active,
  .bottom-nav-item:active {
    color: var(--sage-dark);
  }

  .bottom-nav-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    transition: stroke 0.2s;
  }

  /* Tutty IA — acento especial */
  .bottom-nav-tutty {
    color: var(--sage);
  }
  .bottom-nav-tutty.active,
  .bottom-nav-tutty:active {
    color: var(--sage-dark);
  }
  .bottom-nav-tutty .bottom-nav-icon {
    filter: drop-shadow(0 0 3px rgba(92,122,95,0.4));
  }

  /* Carrito — badge de cantidad */
  .bottom-nav-cart-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bottom-nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--terra);
    color: var(--white);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.58rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--white);
  }
}
