/* ==========================================================================
   By Karling — Menú móvil UNIFICADO (home + cajas + flores + desayunos + postres)
   Única fuente de verdad. Se carga en todas las páginas con /css/menu.css
   La hamburguesa se anima hasta una × y funciona como botón de cierre.
   Breakpoint: 900px
   ========================================================================== */

/* ── Base (escritorio): hamburguesa y overlay ocultos ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--brown, #8A6150);
  border-radius: 2px;
  transition: all .3s ease;
}
/* Hamburguesa → × */
.hamburger.active span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

.menu-overlay { display: none; }

/* ── Móvil / tablet ── */
@media (max-width: 900px) {

  /* Siempre por encima del panel para que la × quede visible y pulsable */
  .hamburger {
    display: flex;
    position: relative;
    z-index: 10001;
  }

  /* Panel lateral derecho */
  .nav-links {
    display: flex;
    flex-direction: column;
    justify-content: center;   /* centrado vertical */
    align-items: stretch;      /* cada <li> ocupa todo el ancho del panel */
    gap: 1.75rem;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(80vw, 320px);
    height: 100vh;
    height: 100dvh;            /* barra de direcciones móvil */
    margin: 0;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    background: var(--white, #fff);
    box-shadow: -4px 0 24px rgba(138, 97, 80, .18);
    text-align: center;
    /* oculto por defecto: fuera de pantalla y sin foco por teclado */
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
    z-index: 10000;
  }
  .nav-links.active {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s ease, visibility 0s;
  }

  .nav-links li {
    width: 100%;
    list-style: none;
    text-align: center;        /* centrado horizontal de TODOS los items */
  }
  .nav-links a {
    display: block;
    padding: .4rem 0;
    font-size: 1rem;
  }
  .nav-links .nav-cta {
    display: inline-block;     /* "Pedir ahora" como píldora centrada */
    width: auto;
    padding: .7rem 1.9rem;
  }

  /* Fondo oscuro detrás del panel (toque fuera = cerrar) */
  .menu-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(61, 35, 24, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 9999;
  }
  .menu-overlay.active { opacity: 1; pointer-events: auto; }

  /* Con el menú abierto el <nav> sube sobre todo (incluido el botón flotante de WhatsApp z-index 999) */
  nav.menu-open { z-index: 10000; }
  body.menu-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links, .nav-links.active, .menu-overlay, .hamburger span { transition: none; }
}
