/**
 * css/wiclee-mobile-menu.css — Menú lateral a pantalla completa (drawer + overlay).
 *
 * Reutilizable en landing y portales. Depende de css/tokens.css. Sin hex; BEM
 * wiclee-mobile-menu*. Activar con js/wicleeMobileMenu.js (data-wiclee-mobile-menu).
 */

.wiclee-mobile-menu__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wiclee-mobile-menu {
  --wiclee-mobile-menu-overlay: color-mix(in srgb, var(--wiclee-text) 55%, transparent);
  /* Tablet+: panel lateral; móvil: ancho completo (mismo corte que labanda w-full / sm:w-[400px]) */
  --wiclee-mobile-menu-panel-width: min(100%, 24rem);
  --wiclee-mobile-menu-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wiclee-mobile-menu-duration: 0.38s;

  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.wiclee-mobile-menu[hidden] {
  display: block;
}

.wiclee-mobile-menu.is-open {
  pointer-events: auto;
  visibility: visible;
}

.wiclee-mobile-menu__overlay {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: var(--wiclee-mobile-menu-overlay);
  opacity: 0;
  backdrop-filter: blur(6px);
  transition: opacity var(--wiclee-mobile-menu-duration) ease;
}

.wiclee-mobile-menu.is-open .wiclee-mobile-menu__overlay {
  opacity: 1;
}

.wiclee-mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: var(--wiclee-mobile-menu-panel-width);
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--wiclee-bg-card);
  color: var(--wiclee-text);
  box-shadow: var(--wiclee-shadow-lg, 0 24px 48px color-mix(in srgb, var(--wiclee-text) 22%, transparent));
  transform: translateX(100%);
  transition: transform var(--wiclee-mobile-menu-duration) var(--wiclee-mobile-menu-ease);
}

.wiclee-mobile-menu.is-open .wiclee-mobile-menu__panel {
  transform: translateX(0);
}

.wiclee-mobile-menu--brand .wiclee-mobile-menu__panel {
  background: var(--wiclee-gradient-brand);
  color: var(--wiclee-text-inverse);
}

.wiclee-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wiclee-space-md);
  flex-shrink: 0;
  min-height: calc(var(--wiclee-landing-header-h, 76px) + env(safe-area-inset-top, 0));
  padding: env(safe-area-inset-top, 0) var(--wiclee-space-md) 0;
  background: var(--wiclee-bg-card);
  border-bottom: 1px solid var(--wiclee-border);
}

.wiclee-mobile-menu--brand .wiclee-mobile-menu__head {
  background: var(--wiclee-bg-card);
  color: var(--wiclee-text);
}

.wiclee-mobile-menu__logo {
  display: block;
  flex: 1;
  min-width: 0;
}

.wiclee-mobile-menu__logo img {
  width: auto;
  height: 46px;
  max-width: 100%;
}

.wiclee-mobile-menu__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: var(--wiclee-radius-md, 10px);
  background: transparent;
  color: var(--wiclee-primary-800);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wiclee-mobile-menu__close:hover {
  background: var(--wiclee-primary-50);
  color: var(--wiclee-primary-900);
}

.wiclee-mobile-menu__close .wiclee-landing__icon {
  width: 24px;
  height: 24px;
}

.wiclee-mobile-menu__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--wiclee-space-lg) var(--wiclee-space-md) var(--wiclee-space-md);
}

.wiclee-mobile-menu__nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiclee-mobile-menu__item {
  margin: 0;
  padding: 0;
}

.wiclee-mobile-menu__link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--wiclee-space-sm) var(--wiclee-space-sm);
  border-radius: var(--wiclee-radius-md, 10px);
  color: inherit;
  font-size: var(--wiclee-font-size-lg, 1.125rem);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  opacity: 0;
  transform: translateX(12px);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wiclee-mobile-menu.is-open .wiclee-mobile-menu__link {
  animation: wiclee-mobile-menu-link-in 0.45s var(--wiclee-mobile-menu-ease) backwards;
}

.wiclee-mobile-menu__item:nth-child(1) .wiclee-mobile-menu__link { animation-delay: 0.06s; }
.wiclee-mobile-menu__item:nth-child(2) .wiclee-mobile-menu__link { animation-delay: 0.1s; }
.wiclee-mobile-menu__item:nth-child(3) .wiclee-mobile-menu__link { animation-delay: 0.14s; }
.wiclee-mobile-menu__item:nth-child(4) .wiclee-mobile-menu__link { animation-delay: 0.18s; }
.wiclee-mobile-menu__item:nth-child(5) .wiclee-mobile-menu__link { animation-delay: 0.22s; }
.wiclee-mobile-menu__item:nth-child(6) .wiclee-mobile-menu__link { animation-delay: 0.26s; }
.wiclee-mobile-menu__item:nth-child(7) .wiclee-mobile-menu__link { animation-delay: 0.3s; }
.wiclee-mobile-menu__item:nth-child(8) .wiclee-mobile-menu__link { animation-delay: 0.34s; }

@keyframes wiclee-mobile-menu-link-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.wiclee-mobile-menu--brand .wiclee-mobile-menu__link:hover,
.wiclee-mobile-menu--brand .wiclee-mobile-menu__link:focus-visible {
  background: color-mix(in srgb, var(--wiclee-text-inverse) 14%, transparent);
  color: var(--wiclee-text-inverse);
}

.wiclee-mobile-menu:not(.wiclee-mobile-menu--brand) .wiclee-mobile-menu__link:hover,
.wiclee-mobile-menu:not(.wiclee-mobile-menu--brand) .wiclee-mobile-menu__link:focus-visible {
  background: var(--wiclee-primary-50);
  color: var(--wiclee-text);
}

.wiclee-mobile-menu__foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wiclee-space-sm);
  padding: var(--wiclee-space-md);
  padding-bottom: calc(var(--wiclee-space-md) + env(safe-area-inset-bottom, 0));
  border-top: 1px solid color-mix(in srgb, var(--wiclee-text-inverse) 22%, transparent);
}

.wiclee-mobile-menu:not(.wiclee-mobile-menu--brand) .wiclee-mobile-menu__foot {
  border-top-color: var(--wiclee-border);
}

.wiclee-mobile-menu__foot .wiclee-landing__btn {
  width: 100%;
  justify-content: center;
}

/* Botón disparador (hamburguesa animada) */
.wiclee-mobile-menu__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: var(--wiclee-radius-md, 10px);
  background: var(--wiclee-primary);
  color: var(--wiclee-text);
  cursor: pointer;
}

.wiclee-mobile-menu__trigger[aria-expanded="true"] {
  background: var(--wiclee-primary-600);
}

.wiclee-mobile-menu__burger {
  position: relative;
  display: block;
  width: 22px;
  height: 16px;
}

.wiclee-mobile-menu__burger span {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.32s var(--wiclee-mobile-menu-ease), opacity 0.2s ease, top 0.32s var(--wiclee-mobile-menu-ease);
}

.wiclee-mobile-menu__burger span:nth-child(1) {
  top: 0;
}

.wiclee-mobile-menu__burger span:nth-child(2) {
  top: 7px;
}

.wiclee-mobile-menu__burger span:nth-child(3) {
  top: 14px;
}

.wiclee-mobile-menu__trigger[aria-expanded="true"] .wiclee-mobile-menu__burger span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.wiclee-mobile-menu__trigger[aria-expanded="true"] .wiclee-mobile-menu__burger span:nth-child(2) {
  opacity: 0;
}

.wiclee-mobile-menu__trigger[aria-expanded="true"] .wiclee-mobile-menu__burger span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

html.wiclee-mobile-menu--scroll-lock {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

html.wiclee-mobile-menu--scroll-lock body {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

/* Móvil: drawer a ancho completo (evita franja lateral con panel de 24rem) */
@media (max-width: 639px) {
  .wiclee-mobile-menu {
    --wiclee-mobile-menu-panel-width: 100%;
  }

  .wiclee-mobile-menu__panel {
    left: 0;
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wiclee-mobile-menu {
    --wiclee-mobile-menu-duration: 0.01ms;
  }

  .wiclee-mobile-menu__link {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .wiclee-mobile-menu__burger span {
    transition-duration: 0.01ms;
  }
}
