/*
 * Base + primitives globales. Solo tokens (tokens/_tokens.css).
 * Referencia de comportamiento: migration-harness/design/prototipo/styles.css.
 */

/* Reset mínimo */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-offset, 0px) + var(--space-8)); }
body {
	margin: 0;
	background: var(--color-surface-base);
	color: var(--color-text-primary);
	font-family: var(--font-family-base);
	font-size: var(--type-body-size);
	line-height: var(--type-body-line);
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea, summary { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Foco visible (§9) */
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
:focus:not(:focus-visible) { outline: none; }

/* Tipografía (§4.2) — títulos sin punto final; jerarquía sin saltos */
h1, h2, h3, h4 { margin: 0; color: inherit; text-wrap: balance; }
/* Títulos de página (pedido 2026-10-28: los H1 internos eran demasiado grandes). Derivado de los tokens, sin tocarlos:
   72% del display, nunca menos que un H2. El display entero queda para el hero del home. */
:root { --type-page-title-size: max(var(--type-h2-size), calc(var(--type-display-size) * .72)); }
h1 { font-size: var(--type-page-title-size); line-height: var(--type-display-line); font-weight: var(--font-weight-extrabold); letter-spacing: -.035em; }
h2 { font-size: var(--type-h2-size); line-height: var(--type-h2-line); font-weight: var(--font-weight-bold); letter-spacing: -.03em; }
h3 { font-size: var(--type-h3-size); line-height: var(--type-h3-line); font-weight: var(--font-weight-bold); letter-spacing: -.02em; }
p { margin: 0 0 var(--space-4); }
.prose { max-width: 70ch; }
.prose > * + * { margin-top: var(--space-4); }
.lead { font-size: var(--type-body-large-size); line-height: var(--type-body-large-line); color: var(--color-text-secondary); }
.small { font-size: var(--type-small-size); line-height: var(--type-small-line); }
.eyebrow {
	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); /* brand.primary sobre blanco no da AA (⚠ README: contraste) */
	margin: 0 0 var(--space-3);
}

/* Layout (§5) */
.wrap { width: min(var(--layout-content-max), 100% - 2 * var(--layout-gutter)); margin-inline: auto; }
.section { padding-block: var(--section-padding); }
.section--warm { background: var(--color-surface-warm); }
.section--warm + .section--warm { padding-top: 0; } /* dos bloques cálidos seguidos se leen como uno (home: hoteles + opiniones) */

/* Iconos (§4.4): SVG inline, trazo 1.6, caja 24 */
svg { width: var(--icon-size); height: var(--icon-size); fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Primitive: Button (§6.2) */
.button {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--space-5);
	min-height: var(--button-height);
	padding: 14px 23px;
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	font-size: 15px; font-weight: var(--font-weight-bold); line-height: 1.2;
	white-space: nowrap;
	transition: background-color var(--motion-control), border-color var(--motion-control), transform var(--motion-control);
}
.button svg { width: 20px; height: 20px; }
.button:active { transform: translateY(1px); }
.button--primary { background: var(--color-brand-primary); color: var(--color-on-brand, var(--color-text-primary)); } /* --color-on-brand: solo en marca blanca de hoteles */
.button--primary:hover { background: var(--color-brand-hover); }
.button--outline { background: transparent; border-color: var(--color-border-default); color: var(--color-text-primary); }
.button--outline:hover { background: var(--color-surface-warm); }
.button[disabled], .button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
/* Loading (§6.2): conserva el ancho y cambia el ícono por un spinner; el JS marca aria-busy. */
.button.is-loading { pointer-events: none; }
.button.is-loading > svg { display: none; }
.button.is-loading::after, #place_order.is-loading::after, .booking-panel .single_add_to_cart_button.is-loading::after { content: ""; flex: none; width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: var(--radius-pill); background: none; -webkit-mask: none; mask: none; animation: lauke-spin 800ms linear infinite; }
@keyframes lauke-spin { to { transform: rotate(360deg); } }
/* Flecha de los CTA que arman Woo/YITH ("Confirmar y pagar", "Reservar Ahora"; Figma). Por CSS: Woo/YITH reescriben
   el texto del botón y borrarían un <svg> interno. */
#place_order::after, .booking-panel .single_add_to_cart_button::after { content: ""; flex: none; width: 20px; height: 20px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
#place_order, .booking-panel .single_add_to_cart_button { gap: var(--space-3); }

.text-link { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--touch-target); font-weight: var(--font-weight-bold); text-decoration: underline; text-underline-offset: 5px; }
.text-link:hover { text-decoration-thickness: 2px; }

.icon-button {
	display: inline-grid; place-items: center;
	width: var(--touch-target); height: var(--touch-target);
	padding: 0; border: 0; background: transparent; border-radius: var(--radius-pill);
	position: relative;
}

/* `hidden` siempre oculta: una regla de componente con `display` (p. ej. las fotos del visor de galería, `display: grid`)
   le ganaba al atributo y se veían todas las fotos juntas (QA 2026-10-14). */
[hidden] { display: none !important; }

/* Accesibilidad */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link {
	position: fixed; left: var(--space-3); top: -100px; z-index: 1000;
	padding: var(--space-4); background: var(--color-surface-base); color: var(--color-text-primary);
	border-radius: var(--radius-control); box-shadow: var(--shadow-overlay); font-weight: var(--font-weight-bold);
}
.skip-link:focus { top: var(--space-2); }
body.is-menu-open { overflow: hidden; }

/* Reduced motion (§4.5) */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 600px) {
	.button { padding: 13px 19px; font-size: 14px; gap: 17px; }
}

/* Fade-in de imágenes lazy (media.js marca data-fade mientras bajan). */
main img[loading="lazy"], main img[data-fade-watched] { transition: opacity 500ms ease-out, transform var(--motion-card); } /* conserva el zoom al pasar el mouse de las cards */
main img[data-fade] { opacity: 0; }
@media (prefers-reduced-motion: reduce) { main img[loading="lazy"] { transition: none; } }

/* Entrada escalonada de grillas (media.js; categorías del home): sube 28px y aparece, 90ms entre tarjetas. */
[data-reveal-stagger] > * { transition: opacity 500ms ease-out, transform 600ms cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--reveal-i, 0) * 90ms); }
[data-reveal-stagger].is-reveal-pending > * { opacity: 0; transform: translateY(28px); }
@media (prefers-reduced-motion: reduce) { [data-reveal-stagger] > * { transition: none; } }
