/* ===== Drawer móvil ===== */
.mobile-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1400;
}

.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(86vw, 320px);
  background: rgba(15, 23, 42, 0.98);
  border-right: 1px solid rgba(255,255,255,0.06);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 1500;
  display: flex; flex-direction: column;
  padding: 14px 14px 18px;
}

.mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}

.mobile-close-btn {
  background: none; border: none; color: var(--light);
  font-size: 22px; cursor: pointer;
}

.mobile-links {
  list-style: none; padding: 8px 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.mobile-links a {
  display: block;
  color: var(--light); text-decoration: none;
  padding: 12px 10px; border-radius: 8px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, transform .15s;
  font-weight: 500;
}
.mobile-links a:active { transform: scale(0.98); }
.mobile-links a:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

.mobile-actions {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid; gap: 10px;
}
.mobile-actions .login-btn {
  display: block; text-align: center;
  padding: 12px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
}
.mobile-actions .register-btn {
  display: block; text-align: center;
  border-radius: 8px; padding: 12px 14px;
}

/* Estado abierto */
body.drawer-open { overflow: hidden; }
body.drawer-open .mobile-drawer { transform: translateX(0); }
body.drawer-open #mobile-backdrop {
  opacity: 1; pointer-events: auto;
}

/* Visibilidad: sólo en móvil */
@media (min-width: 993px) {
  #mobile-backdrop, #mobile-drawer { display: none !important; }
}
/* ——— Altura dinámica del header ——— */
:root { --mh: 0px; }  /* valor por defecto; JS lo ajusta */

/* Drawer debajo del header fijo */
@media (max-width: 992px) {
  #mobile-backdrop,
  #mobile-drawer {
    top: var(--mh);
  }

  /* ocupa todo lo que queda de alto; 100dvh para móviles modernos */
  #mobile-backdrop { 
    height: calc(100dvh - var(--mh));
  }
  #mobile-drawer {
    height: calc(100dvh - var(--mh));
  }
}

/* Z-index alto para ganar a cualquier stacking context con transform */
#mobile-backdrop { z-index: 9998; }
#mobile-drawer   { z-index: 9999; }

/* En pantallas muy pequeñas, usa ancho completo (evita que se vea contenido a la derecha) */
@media (max-width: 520px) {
  .mobile-drawer { width: 80vw; }
}

/* Opcional: oculta el ícono de hamburguesa mientras el drawer está abierto para evitar “doble X” */
body.drawer-open .mobile-menu-btn { visibility: hidden; }


