/*
 * Patterns de layout global: topbar, header, navegación, footer, page shell.
 * Referencia: prototipo styles.css (.topbar/.header/.mobile-nav) y site.css (#site-footer/.footer-grid).
 */

/* Transición: en páginas con contenido Elementor el kit (`.elementor-kit-N a`) sigue en <body>;
   el chrome del theme no hereda sus colores. Quitar al desinstalar Elementor. */
body .topbar a, body .site-header a, body .site-footer a { color: inherit; }
body .topbar a.topbar__expert, body .topbar a.topbar__link, body .topbar a.topbar__business { color: var(--color-text-primary); } /* Figma: texto primario (la regla de arriba lo dejaba en gris) */

/* Topbar (§6.1; Figma Nav: clima a la izquierda, experto a la derecha) */
.topbar { background: var(--color-surface-warm); font-size: var(--type-small-size); color: var(--color-text-secondary); }
.topbar__inner { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.topbar__weather { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; }
.topbar__weather svg { color: var(--color-brand-primary); } /* icono decorativo: no requiere AA de texto */
.topbar__link { display: inline-flex; align-items: center; min-height: 34px; margin-left: auto; padding-right: var(--space-4); border-right: var(--border-default); color: var(--color-text-primary); } /* Empresas (H4) */
.topbar__link { gap: var(--space-2); } /* Mis reservas (2026-10-28) */
.topbar__link svg { width: 16px; height: 16px; }
.topbar__business { display: inline-flex; align-items: center; min-height: 34px; } /* Empresas, a la izquierda (H4) */
.topbar__link:hover, .topbar__business:hover { text-decoration: underline; text-underline-offset: 4px; }
.topbar__expert { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 34px; margin-left: auto; color: var(--color-text-primary); }
.topbar__link + .topbar__expert { margin-left: 0; }
.topbar__expert:hover { text-decoration: underline; text-underline-offset: 4px; }
.topbar svg { width: 16px; height: 16px; }

/* Header */
.site-header { background: var(--color-surface-base); position: relative; z-index: 50; }
/* Header fijo que se va al bajar y vuelve deslizándose al subir (pedido 2026-10-25, revisión cliente #1, H2). nav.js
   pone .is-hidden y --header-offset (alto visible del header) para que los demás elementos fijos se corran debajo. */
.site-header { position: sticky; top: 0; transition: transform var(--motion-overlay), box-shadow var(--motion-overlay); }
.site-header.is-stuck { box-shadow: 0 1px 0 var(--color-border-default); }
.site-header.is-hidden { transform: translateY(-100%); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .site-header { transition: none; } }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: var(--header-height); }
.site-brand { flex-shrink: 0; width: 132px; display: block; }
.site-brand img { width: 100%; height: auto; }
.site-brand__text { font-size: 20px; font-weight: var(--font-weight-extrabold); }

.primary-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--space-8); }
.primary-nav__item { position: relative; display: flex; align-items: center; }
.primary-nav a, .primary-nav__toggle {
	display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--touch-target);
	font: inherit; font-size: var(--type-body-size); font-weight: var(--font-weight-regular); color: var(--color-text-primary);
	white-space: nowrap; background: none; border: 0; padding: 0; cursor: pointer;
}
.primary-nav__toggle svg { width: 16px; height: 16px; transition: transform var(--motion-control); }
.primary-nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.primary-nav__toggle--icon { min-width: var(--space-6); justify-content: center; }
.primary-nav a:hover, .primary-nav__toggle:hover, .primary-nav a[aria-current="page"] {
	text-decoration: underline; text-decoration-color: var(--color-brand-primary); text-decoration-thickness: 2px; text-underline-offset: 6px;
}
/* Panel desplegable: ⚠ sin diseño en Figma/handoff — versión mínima con tokens, validar con diseño. */
.primary-nav__sub {
	position: absolute; top: 100%; left: calc(-1 * var(--space-4)); min-width: 220px; list-style: none; margin: 0;
	padding: var(--space-2); background: var(--color-surface-base); border: var(--border-default);
	border-radius: var(--radius-control); box-shadow: var(--shadow-overlay);
}
.primary-nav__sub a { display: flex; width: 100%; padding-inline: var(--space-3); border-radius: var(--radius-control); }
.primary-nav__sub a:hover { background: var(--color-surface-warm); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.cart-link__count {
	position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding-inline: 4px;
	border-radius: var(--radius-pill); background: var(--color-brand-primary); color: var(--color-on-brand, var(--color-text-primary));
	font-size: 11px; font-weight: var(--font-weight-bold); line-height: 18px; text-align: center;
}
.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 6px; }
.menu-toggle__bar { display: block; width: 21px; height: 1.5px; background: var(--color-text-primary); transition: transform var(--motion-control); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.mobile-nav { background: var(--color-surface-base); border-bottom: var(--border-default); }
/* Abierto: panel fijo debajo del header (top = borde inferior del header, nav.js) con scroll propio. Antes empujaba
   la página y, con el scroll bloqueado, en pantallas bajas no se llegaba a los últimos ítems. */
.mobile-nav:not([hidden]) { position: fixed; left: 0; right: 0; top: var(--mobile-nav-top, 0); bottom: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; border-top: var(--border-default); border-bottom: 0; }
.mobile-nav__cta { margin: var(--space-6) 0 calc(var(--space-6) + env(safe-area-inset-bottom, 0px)); }
.mobile-nav__cta .button { width: 100%; justify-content: center; }
.mobile-nav ul { list-style: none; margin: 0; padding: var(--space-2) 0 var(--space-6); }
.mobile-nav a:not(.button), .mobile-nav__group { display: block; padding: 13px 0; font-size: var(--type-body-size); border-bottom: var(--border-default); }
.mobile-nav__group { font-weight: var(--font-weight-semibold); }
.mobile-nav .mobile-nav__sub { padding: 0 0 0 var(--space-4); }
.mobile-nav__toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; margin: 0; border: 0; border-bottom: var(--border-default); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mobile-nav__row { display: flex; align-items: stretch; border-bottom: var(--border-default); }
.mobile-nav__row > a:not(.button) { flex: 1; border-bottom: 0; }
.mobile-nav__toggle--icon { width: var(--control-height); flex: none; justify-content: center; padding: 0; border-bottom: 0; }
.mobile-nav__chevron { width: 18px; height: 18px; flex: none; transition: transform var(--motion-control); }
.mobile-nav__toggle[aria-expanded="true"] .mobile-nav__chevron { transform: rotate(180deg); }
.mobile-nav__toggle:focus-visible { outline: var(--focus-ring); outline-offset: calc(-1 * var(--focus-offset)); }

@media (max-width: 1320px) and (min-width: 1151px) {
	.primary-nav > ul { gap: var(--space-5); }
	.primary-nav a, .primary-nav__toggle { font-size: var(--type-small-size); }
}
@media (max-width: 1150px) {
	.primary-nav, .header-actions__support { display: none; }
	.menu-toggle { display: flex; }
}
@media (min-width: 1151px) {
	.mobile-nav { display: none !important; }
}
@media (max-width: 600px) {
	.topbar__inner { justify-content: center; font-size: 12px; }
	.topbar__weather ~ .topbar__expert { display: none; } /* Figma mobile: solo clima */
	.topbar__expert, .topbar__link { margin-left: 0; }
	.site-brand { width: 118px; }
	.topbar__business ~ .topbar__link { margin-left: auto; } /* Empresas a la izquierda; el resto, a la derecha */
	.topbar__inner a { white-space: nowrap; }
}
/* Celular angosto: Empresas y Mis reservas; el WhatsApp sigue en el botón flotante y en el menú. */
@media (max-width: 480px) {
	.topbar__business ~ .topbar__expert { display: none; }
	.topbar__business ~ .topbar__link { padding-right: 0; border-right: 0; }
}

/* Page shell genérico (index/page/404) */
.page-shell { padding-block: var(--space-12) var(--section-padding); }
.page-heading { margin-bottom: var(--space-10); }
.page-heading .lead { margin-top: var(--space-3); max-width: 60ch; }
/* 404 (Figma "404") */
.not-found { padding: var(--space-16) var(--space-8); border-radius: var(--radius-feature); background: var(--color-surface-warm); text-align: center; }
.not-found__title { max-width: 18ch; margin: 0 auto var(--space-4); }
.not-found .lead { margin: 0 auto var(--space-10); max-width: 48ch; }
.not-found .button--outline { background: var(--color-surface-base); }
@media (max-width: 700px) { .not-found { padding: var(--space-10) var(--space-5); border-radius: var(--radius-card); } }

/* Footer (Figma Home: superficie oscura = color.text.primary, texto = color.surface.base) */
.site-footer {
	--footer-surface-raised: color-mix(in srgb, var(--color-surface-base) 8%, var(--color-text-primary)); /* derivado de tokens */
	background: var(--color-text-primary); color: var(--color-surface-base);
	padding-block: var(--space-16) var(--space-6); font-size: var(--type-small-size);
}
/* Foco: #176D86 sobre el fondo oscuro no llega a 3:1 → anillo claro (⚠ README: contraste). */
.site-footer :focus-visible { outline-color: var(--color-surface-base); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom a { text-decoration: underline; text-underline-offset: 4px; } /* enlace dentro de texto: subrayado siempre */

.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--space-8); }
.footer-brand__logo { display: inline-block; margin-bottom: var(--space-6); }
.footer-brand__logo img { width: 180px; height: auto; }
.footer-contacts a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 32px; }
.footer-contacts svg { width: 16px; height: 16px; }

.footer-col__title { font-size: var(--type-body-size); line-height: 1.3; letter-spacing: 0; font-weight: var(--font-weight-semibold); margin: var(--space-1) 0 var(--space-4); }
.footer-col a { display: inline-flex; align-items: center; min-height: 32px; }
.footer-payments .payment-logos { max-width: 240px; margin-bottom: var(--space-3); } /* fichas blancas sobre el pie oscuro */

.footer-badges { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-10) !important; }
.footer-badges__item { background: var(--footer-surface-raised); border-radius: var(--space-1); }
.footer-badges__item, .footer-badges__item a { display: flex; align-items: center; justify-content: center; width: 143px; height: 62px; padding: var(--space-2) var(--space-3); }
.footer-badges__item a { padding: 0; width: 100%; height: 100%; }
.footer-badges__item img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.footer-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-3); }
.footer-sites { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.footer-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-target); padding-inline: var(--space-4); background: var(--footer-surface-raised); border-radius: var(--space-1); }
.footer-chip svg { width: 16px; height: 16px; }
.footer-social { display: flex; gap: var(--space-2); }
.footer-social__link { display: inline-flex; align-items: center; justify-content: center; width: var(--touch-target); height: var(--touch-target); background: var(--footer-surface-raised); border-radius: var(--space-1); }

.footer-bottom {
	display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3);
	border-top: 1px solid var(--footer-surface-raised); margin-top: var(--space-10); padding-top: var(--space-6); font-size: var(--type-small-size);
}
/* Crédito del desarrollo más discreto (pedido del cliente 2026-11-11): más chico y gris claro, no blanco. Gris derivado de
   tokens con contraste AA sobre el fondo del pie (~7:1). */
.footer-credit { align-self: center; font-size: var(--type-eyebrow-size); color: color-mix(in srgb, var(--color-surface-base) 60%, var(--color-text-primary)); }

@media (max-width: 1150px) {
	.footer-grid { grid-template-columns: repeat(3, 1fr); }
	.footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
	.site-footer { padding-top: var(--space-12); }
	.footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-5); }
	.footer-payments { grid-column: 1 / -1; }
	.footer-badges__item, .footer-badges__item a { width: auto; flex: 1 1 0; min-width: 0; }
	.footer-row { flex-direction: column; }
	.footer-bottom { flex-direction: column; }
}

/* ---------- Cabecera y pie reducidos (pasos 3 a 5 de la reserva y marca blanca de hoteles) ---------- */
.site-header--checkout { border-bottom: var(--border-default); }
.site-header--checkout .topbar__expert { margin-left: auto; }
.site-footer--checkout { padding-block: var(--space-6); }
.site-footer--checkout .footer-bottom { margin-top: 0; padding-top: 0; border-top: 0; } /* sin la franja vacía del pie completo */

/* ---------- Selector de idioma y moneda (Figma "Nav"; header-switchers.php) ---------- */
.switchers { position: relative; display: flex; align-items: center; gap: var(--space-1); margin-right: var(--space-2); }
/* Aviso de moneda al cambiar de idioma (H3): globo debajo de los selectores. */
.currency-notice { position: absolute; top: calc(100% + var(--space-3)); right: 0; z-index: 60; display: flex; align-items: center; gap: var(--space-3); width: max-content; max-width: min(360px, calc(100vw - 2 * var(--layout-gutter))); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border: var(--border-default); border-radius: var(--radius-card); background: var(--color-surface-base); box-shadow: var(--shadow-overlay); font-size: var(--type-small-size); color: var(--color-text-primary); }
.currency-notice[hidden] { display: none; }
.currency-notice__text { margin: 0; }
.currency-notice__actions { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.currency-notice .text-link { border: 0; background: none; padding: 0; font: inherit; font-weight: var(--font-weight-semibold); white-space: nowrap; cursor: pointer; }
.currency-notice__close { width: var(--touch-target); height: var(--touch-target); }
@media (max-width: 600px) { .currency-notice { position: fixed; top: calc(var(--header-offset, 72px) + var(--space-2)); left: var(--layout-gutter); right: var(--layout-gutter); width: auto; max-width: none; } } /* los selectores no están en el borde: debajo del header, a todo el ancho */
.switcher { position: relative; }
.switcher__toggle { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--touch-target); padding-inline: var(--space-2); border-radius: var(--radius-control); font-size: var(--type-small-size); cursor: pointer; list-style: none; white-space: nowrap; }
.switcher__toggle::-webkit-details-marker { display: none; }
.switcher__toggle > span[aria-hidden] { display: inline-flex; align-items: center; gap: var(--space-2); }
.switcher__toggle:hover { background: var(--color-surface-warm); }
.switcher__toggle:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.switcher__toggle > svg { width: 16px; height: 16px; transition: transform var(--motion-control); }
.switcher[open] > .switcher__toggle > svg { transform: rotate(180deg); }
.switcher__flag { width: 21px; height: 15px; border-radius: 2px; flex: none; stroke: none; } /* sin el trazo de los íconos */
.switcher__flag * { stroke: none; }
.switcher__menu { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 70; /* sobre el menú mobile abierto (60) */ min-width: 200px; width: max-content; max-width: min(320px, calc(100vw - 2 * var(--layout-gutter))); margin: 0; padding: var(--space-2); list-style: none; border: var(--border-default); border-radius: var(--radius-control); background: var(--color-surface-base); box-shadow: var(--shadow-overlay); }
.switcher__menu ul { list-style: none; margin: 0; padding: 0; }
.switcher__option { display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch-target); padding-inline: var(--space-3); border-radius: var(--radius-control); color: var(--color-text-primary); text-decoration: none; font-size: var(--type-small-size); }
.switcher__option:hover { background: var(--color-surface-warm); }
.switcher__option[aria-current="true"] { font-weight: var(--font-weight-bold); box-shadow: inset 3px 0 0 var(--color-brand-primary); } /* naranja como marca, no como texto (AA) */
.switcher__option strong { min-width: 3ch; }
.switcher__option span { white-space: nowrap; }
.switcher__option strong + span { color: var(--color-text-secondary); }
.switcher__group { margin: var(--space-2) var(--space-3) var(--space-1); font-size: var(--type-eyebrow-size); font-weight: var(--font-weight-bold); letter-spacing: var(--type-eyebrow-tracking); text-transform: uppercase; color: var(--color-text-secondary); }
.switcher--combined { display: none; }
@media (max-width: 700px) {
	.header-actions__support { display: none; } /* Figma mobile: logo, ES · ARS, carrito y menú (el asesor está en el menú y la topbar) */
	.switchers { margin-right: 0; }
	.switcher--lang, .switcher--currency { display: none; }
	.switcher--combined { display: block; }
	.switcher__menu { right: calc(-1 * var(--space-12)); }
}
/* Celulares angostos (320–600): logo, ES · ARS, carrito y menú entran en una línea. */
@media (max-width: 600px) {
	.site-header .site-header__inner { gap: var(--space-3); }
	.site-header .site-brand:not(.site-brand--hotel) { width: 104px; }
	.header-actions { gap: 0; }
	.switcher__toggle { padding-inline: var(--space-1); }
	/* El panel se alinea al borde derecho del header (no al botón): a 320 se salía 14px por la izquierda. */
	.site-header .site-header__inner { position: relative; }
	.site-header .switcher { position: static; }
	.site-header .switcher__menu { right: 0; }
}

/* Botón de WhatsApp (Joinchat) por encima de las barras fijas de celular ("Reservar Ahora" en la ficha, "Continuar" en
   el carrito): antes tapaba el botón. */
@media (max-width: 960px) {
	body:has(.cart-bar) .joinchat { --bottom: calc(var(--button-height) + var(--space-8) + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (max-width: 700px) {
	body:has(.booking-bar:not(.is-hidden)) .joinchat { --bottom: calc(var(--button-height) + var(--space-8) + env(safe-area-inset-bottom, 0px)) !important; }
}
