/* ============================================================
   GALLETAS PITUCA — Responsive Premium
   Preserva fixes de menú móvil y refina ritmo por breakpoint.
============================================================ */

/* ---------- LAPTOP (<= 1100px) ---------- */
@media (max-width: 1100px) {
  :root {
    --container: 960px;
  }

  .grid-4,
  .grid-3,
  .grid-productos,
  .grid-super {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .split--historia {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .section {
    padding: 5.5rem 0;
  }

  .section--wide {
    padding: 6.5rem 0;
  }

  .section--tight {
    padding: 4rem 0;
  }

  .historia-photo {
    margin-right: 16px;
    margin-bottom: 16px;
  }
}

/* ---------- TABLET (<= 860px) ---------- */
@media (max-width: 860px) {
  :root {
    --sp-section: 5.5rem;
  }

  .main-nav ul {
    gap: 24px;
  }

  .main-nav a {
    font-size: 0.85rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero {
    min-height: 520px;
  }

  .section-dark--historia,
  .section-dark--valores {
    background-attachment: scroll;
  }
}

/* ---------- MÓVIL (<= 680px) ---------- */
@media (max-width: 680px) {
  :root {
    --sp-section: 4.5rem;
    --header-h: 68px;
    --header-h-scrolled: 60px;
  }

  .container {
    padding: 0 20px;
  }

  /* HEADER: altura natural, contenido centrado */
  .site-header {
    height: auto !important;
    min-height: var(--header-h);
    overflow: visible;
  }

  .header-inner {
    height: auto;
    min-height: var(--header-h);
    padding: 6px 0;
  }

  /* HAMBURGUESA visible */
  .nav-toggle {
    display: block;
  }

  /* MENÚ CERRADO: inexistente (cero franjas fantasma) */
  .main-nav {
    display: none;
  }

  /* MENÚ ABIERTO: panel colgado bajo el header */
  .main-nav.is-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--c-cream-soft);
    border-bottom: 1px solid rgba(232, 119, 34, 0.08);
    box-shadow: 0 8px 24px rgba(53, 29, 13, 0.08);
    padding: 18px 22px 26px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .main-nav a {
    display: block;
    padding: 12px;
    font-size: 0.95rem;
    border-radius: var(--r-sm);
  }

  .main-nav a::after {
    display: none;
  }

  .main-nav a.active {
    background: rgba(232, 119, 34, 0.08);
    color: var(--c-accent);
  }

  /* HERO */
  .hero {
    min-height: 480px;
    padding: 5.5rem 0;
  }

  .hero--home {
    margin-top: 0;
    min-height: auto;
    padding: 5rem 0 6rem;
  }

  .hero-panel {
    padding: 36px 28px 44px;
  }

  .hero-scroll {
    bottom: 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    justify-content: center;
  }

  /* GRIDS 1 columna */
  .grid-4,
  .grid-3,
  .grid-productos,
  .grid-super {
    grid-template-columns: 1fr;
  }

  /* STATS compactas */
  .stats {
    gap: 10px;
  }

  .stats article {
    padding: 14px 8px;
  }

  .stats strong {
    font-size: 1.35rem;
  }

  .stats span {
    font-size: 0.68rem;
  }

  /* TIMELINE chip */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .timeline-year {
    justify-self: start;
    width: auto;
    padding: 8px 20px;
    font-size: 1.1rem;
    border-radius: var(--r-pill);
  }

  /* FOTO HISTORIA */
  .historia-photo {
    margin-right: 0;
    margin-bottom: 26px;
  }

  .photo-badge {
    right: 12px;
    bottom: 12px;
    padding: 12px 18px;
  }

  .photo-badge strong {
    font-size: 1.5rem;
  }

  .photo-badge span {
    font-size: 0.7rem;
  }

  /* VARIOS */
  .note-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 26px 22px;
  }

  .super-logo {
    height: 140px;
  }

  .cta-card {
    padding: 42px 26px;
  }

  .quote-box {
    padding: 18px 20px;
    font-size: 1rem;
  }

  .section-head {
    margin-bottom: 44px;
  }

  .contact-form-wrap {
    padding: 32px 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* FOOTER centrado */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    text-align: center;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-logo-row {
    justify-content: center;
  }

  .footer-brand p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-col ul {
    align-items: center;
  }

  .footer-bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  /* CHAT */
  .chat-float {
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }
}

/* ---------- MÓVIL PEQUEÑO (<= 400px) ---------- */
@media (max-width: 400px) {
  .brand-text strong {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
  }

  .brand-logo {
    height: 40px;
  }

  .hero-panel {
    padding: 30px 20px 40px;
  }

  .cta-card {
    padding: 36px 20px;
  }

  .contact-form-wrap {
    padding: 28px 18px;
  }
}

/* ---------- HOVER REAL ---------- */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover .product-media img {
    transform: scale(1.06);
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}