/* ============================================================
   MAIN.CSS — Header, Footer, Layout, Utilities, Dotted grid
   ============================================================ */

/* ── Body base ── */
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--alice-blue);
  background-color: var(--ink-black);
  cursor: none; /* replaced by cursor-fog.js */
  overflow-x: clip; /* guard anti-desbordamiento horizontal en móvil */
}

/* clip (no hidden) para cortar overflow horizontal sin romper position:sticky
   de descendientes como el calendario de reservas */
html { overflow-x: clip; }

@media (hover: none) {
  body { cursor: auto; }
}

/* ── Dotted grid utility classes ── */
.bg-dotted {
  background-image: var(--dot-light);
  background-size: 45px 45px;
}
.bg-dotted--mid {
  background-image: var(--dot-mid);
  background-size: 45px 45px;
}
.bg-dotted--dark {
  background-image: var(--dot-dark);
  background-size: 45px 45px;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-20);
}

/* ── Main (offset header) ── */
main {
  padding-top: var(--header-height);
}

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: var(--z-sticky);
  background: rgba(8, 10, 19, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid);
  display: flex;
  align-items: center;
}

.header.is-scrolled {
  border-bottom-color: rgba(20, 49, 209, 0.4);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* Logo */
.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 40px;
  color: var(--raspberry);
  transition: color var(--t-mid);
}

.header__logo:hover { color: var(--hot-fuchsia); }

.header__logo-svg {
  height: 40px;
  width: auto;
  transition: none;
}

.header__logo-fallback {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-xl);
  color: var(--raspberry);
  letter-spacing: 2px;
  transition: color var(--t-mid);
}
.header__logo-fallback:hover { color: var(--hot-fuchsia); }

/* Nav */
.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.header__nav-link {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--alice-blue);
  transition: color var(--t-fast);
  position: relative;
  padding-block: var(--space-1);
}

.header__nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--raspberry);
  transition: width var(--t-mid);
}

.header__nav-link:hover { color: var(--raspberry); }
.header__nav-link:hover::after,
.header__nav-link.is-active::after { width: 100%; }
.header__nav-link.is-active { color: var(--hot-fuchsia); }

/* Header actions */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.header__action-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--alice-blue);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast), background var(--t-fast);
}

.header__action-btn:hover {
  color: var(--raspberry);
  background: rgba(225, 39, 88, 0.1);
}

.header__action-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Cart badge */
.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding-inline: 3px;
  background: var(--raspberry);
  color: white;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--t-fast), transform var(--t-fast);
  pointer-events: none;
}

.cart-badge.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Mobile hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 4px;
}

.header__hamburger-line {
  width: 100%;
  height: 2px;
  background: var(--alice-blue);
  border-radius: 2px;
  transition: transform var(--t-mid), opacity var(--t-mid), width var(--t-mid);
  transform-origin: center;
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(2) {
  opacity: 0;
  width: 0;
}
.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 19, 0.8);
  z-index: calc(var(--z-sticky) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-mid);
}
.drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.mobile-drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: var(--deep-navy);
  border-left: 1px solid rgba(20, 49, 209, 0.4);
  z-index: var(--z-sticky);
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transform: translateX(100%);
  transition: transform var(--t-slow);
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.mobile-drawer__link {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--alice-blue);
  padding-block: var(--space-3);
  border-bottom: 1px solid rgba(237, 243, 255, 0.08);
  transition: color var(--t-fast);
}
.mobile-drawer__link:hover { color: var(--raspberry); }

/* Cart popup */
.cart-popup {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  right: var(--space-6);
  width: 320px;
  background: var(--deep-navy);
  border: 1px solid rgba(150, 44, 221, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow-violet);
  z-index: var(--z-popup);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: opacity var(--t-mid), transform var(--t-mid);
}

.cart-popup.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.cart-popup__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(237, 243, 255, 0.08);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--alice-blue);
}

.cart-popup__body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cart-popup__empty {
  text-align: center;
  color: var(--win-text-muted);
  padding-block: var(--space-4);
  font-size: var(--text-sm);
}

.cart-popup__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cart-popup__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(237, 243, 255, 0.06);
}

.cart-popup__item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.cart-popup__item-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  padding-left: var(--space-3);
}
.cart-popup__date { color: var(--alice-blue); font-weight: 700; }
.cart-popup__time { color: var(--win-text-muted); }
.cart-popup__price { color: var(--turquoise); font-weight: 700; white-space: nowrap; }
.cart-popup__remove {
  background: none;
  border: none;
  color: var(--win-text-muted);
  cursor: none;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: color var(--t-fast);
  line-height: 1;
}
.cart-popup__remove:hover { color: var(--raspberry); }

.cart-popup__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-top: 1px solid rgba(237, 243, 255, 0.1);
  font-weight: 700;
  color: var(--alice-blue);
}

.cart-popup__total strong { color: var(--turquoise); }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.footer {
  background: var(--ink-black);
  border-top: 1px solid var(--persian-blue);
  padding-top: var(--space-16);
  padding-bottom: var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(237, 243, 255, 0.06);
}

.footer__logo-svg {
  height: 36px;
  width: auto;
  color: var(--raspberry);
  margin-bottom: var(--space-4);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--win-text-muted);
  line-height: 1.6;
}

.footer__col-title {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--win-text-muted);
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--alice-blue);
  transition: color var(--t-fast);
}
.footer__link:hover { color: var(--raspberry); }

.footer__socials {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__social-link {
  color: var(--alice-blue);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: color var(--t-fast);
}

a.footer__social-link:hover { color: var(--raspberry); }

.footer__social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

.footer__social-link span {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}

.footer__social-link--soon {
  opacity: 0.35;
  cursor: default;
}

.footer__contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--alice-blue);
  margin-bottom: var(--space-3);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--win-text-muted);
}

/* ── Text utilities ── */
.text-fuchsia    { color: var(--hot-fuchsia); }
.text-raspberry  { color: var(--raspberry); }
.text-turquoise  { color: var(--turquoise); }
.text-violet     { color: var(--blue-violet); }
.text-muted      { color: var(--win-text-muted); }
.text-display    { font-family: var(--font-display); }
.text-ui         { font-family: var(--font-ui); }
.text-accent     { font-family: var(--font-accent); }
.text-upper      { text-transform: uppercase; letter-spacing: 1.5px; }

/* ── Visibility ── */
.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;
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}

@media (max-width: 768px) {
  .header__nav { display: none; }
  .header__hamburger { display: flex; }
  .cart-popup { right: var(--space-4); width: calc(100vw - 2 * var(--space-4)); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .footer__bottom { flex-direction: column; gap: var(--space-3); text-align: center; }
}
