/* Base compartida — Hostal Santa Ana
 * Escala tipográfica: tercera mayor (1,25) sobre 17 px, 7 roles. Valores fluidos 390 → 1440 px.
 * Espaciado en retícula de 4/8. Layout de 12 columnas.
 * Paleta: fachada (cal, madera), logo (madera), chin (crudo, seco). El tinte (--accion) es solo para la acción principal.
 */
:root {
  --cal: #F5F2EA;
  --cal-sombra: #EBE4D4;
  --madera: #542E1E;
  --madera-osc: #2A1C15;
  --chin-crudo: #C3C58E;
  --chin-seco: #DCC791;
  --texto: var(--madera-osc);
  --texto-2: #5E4A3E;           /* 7,4:1 sobre cal */
  --linea: rgba(42, 28, 21, .18);

  --fs-display: clamp(44px, calc(30.26px + 3.524vw), 81px);
  --fs-h1: clamp(34px, calc(27.31px + 1.714vw), 52px);
  --fs-h2: clamp(27px, calc(24.77px + .571vw), 33px);
  --fs-h3: clamp(21px, calc(18.77px + .571vw), 27px);
  --fs-lead: 21px;
  --fs-body: 17px;
  --fs-small: 13.6px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --gutter: 16px;
  --max: 1320px;
  --header-h: 72px;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s4)); }
body {
  margin: 0;
  background: var(--cal);
  color: var(--texto);
  font-size: var(--fs-body);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em, i { font-style: normal; } /* sin cursivas para enfatizar */
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accion); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s5); }
.grid > * { grid-column: 1 / -1; }

/* ---------- Botones: un solo estilo primario ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  border: 0; border-radius: 0;
  background: var(--accion); color: #fff;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--accion-hover); }
.btn:active { transform: translateY(1px); }
.btn-sec {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s4);
  border: 1.5px solid currentColor; background: transparent;
  text-decoration: none; font-weight: 600;
}
.btn-sec svg, .btn svg { width: 20px; height: 20px; flex: none; }
.enlace { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; min-height: 48px; display: inline-flex; align-items: center; }

/* ---------- Encabezado fijo ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(245, 242, 234, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.cabecera .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
.marca { display: flex; align-items: center; gap: var(--s3); text-decoration: none; }
.marca img { height: 44px; width: auto; }
.nav { display: none; gap: var(--s5); }
.nav a { text-decoration: none; font-size: var(--fs-small); font-weight: 600; padding: var(--s3) 0; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 1024px) { .nav { display: flex; } }
.cabecera .btn { min-height: 44px; }
@media (max-width: 767px) { .cabecera .btn { display: none; } }

/* ---------- Héroe: TENZA detrás de las montañas ---------- */
.heroe { position: relative; overflow: hidden; }
.heroe-palabra {
  position: relative; z-index: 1;
  text-align: center; line-height: .8;
  user-select: none;
  white-space: nowrap;
}
.heroe-valle { position: relative; z-index: 2; margin: 0 auto; width: 100%; }
.heroe-valle img { width: 100%; height: auto; }
.heroe-valle figcaption {
  position: absolute; right: var(--s3); bottom: var(--s2);
  font-size: 11px; letter-spacing: .02em; color: rgba(245, 242, 234, .9);
}

/* ---------- Widget de reserva (región común) ---------- */
.reserva { display: grid; gap: var(--s2); }
.reserva { min-width: 0; }
.reserva-campos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); }
.campo { display: grid; gap: var(--s1); min-width: 0; }
.campo label { font-size: var(--fs-small); font-weight: 600; }
.campo input, .campo select {
  width: 100%; min-width: 0; min-height: 48px; padding: 0 var(--s3);
  border: 1.5px solid rgba(42, 28, 21, .45); border-radius: 0;
  background: #fff; color: var(--madera-osc);
  -webkit-appearance: none; appearance: none;
}
.campo select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.campo-huespedes { grid-column: 1 / -1; }
.reserva .btn { width: 100%; }
.reserva-nota { font-size: var(--fs-small); color: var(--texto-2); }
.reserva-error { font-size: var(--fs-small); font-weight: 600; color: #8A1E12; min-height: 0; }
.reserva-error:empty { display: none; }
@media (min-width: 900px) {
  .reserva-linea { grid-template-columns: 1fr auto; align-items: end; }
  .reserva-linea .reserva-campos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reserva-linea .campo-huespedes { grid-column: auto; }
  .reserva-linea .btn { width: auto; padding: 0 var(--s6); }
}

/* ---------- Barra fija inferior en móvil ---------- */
.barra-movil {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr auto; gap: var(--s2);
  padding: var(--s2) var(--gutter) calc(var(--s2) + env(safe-area-inset-bottom));
  background: var(--cal); border-top: 1px solid var(--linea);
}
.barra-movil .btn-sec { color: var(--madera-osc); }
@media (min-width: 768px) { .barra-movil { display: none; } }
@media (max-width: 767px) { body { padding-bottom: 72px; } }

/* ---------- Trama ---------- */
.trama { position: relative; overflow: hidden; background: var(--madera-osc); }
.trama > canvas { position: absolute; inset: 0; display: block; }
.banda { height: 40px; }

/* imagen cortada en tiras */
[data-tiras] { position: relative; display: flex; gap: 6px; overflow: hidden; }
[data-tiras] .tira {
  position: relative; flex: 1; overflow: hidden;
}
[data-tiras] .tira:nth-child(odd) { transform: translateY(calc(var(--desfase, 14px) * -1)); }
[data-tiras] .tira:nth-child(even) { transform: translateY(var(--desfase, 14px)); }
[data-tiras] .tira img {
  position: absolute; top: 0; height: 100%;
  width: calc(var(--n) * 100% + (var(--n) - 1) * 6px);
  left: calc(var(--i) * -100% - var(--i) * 6px);
  max-width: none; object-fit: cover;
}

/* ---------- Habitaciones: lista numerada ---------- */
.hab-lista { counter-reset: hab; border-top: 1px solid var(--linea); }
.hab { position: relative; border-bottom: 1px solid var(--linea); }
.hab-tejido { position: absolute; pointer-events: none; }
.hab-tejido canvas { position: absolute; inset: 0; }

/* ---------- Pie ---------- */
.pie { padding: var(--s9) 0 var(--s8); }
.pie small { font-size: var(--fs-small); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Flujo de reserva (prototipo) ---------- */
html.flujo-abierto { overflow: hidden; }
dialog.flujo {
  padding: 0; border: 0; margin: 0; inset: 0;
  width: 100%; max-width: none; height: 100dvh; max-height: none;
  background: var(--cal); color: var(--texto);
}
dialog.flujo::backdrop { background: rgba(42, 28, 21, .6); }
.flujo-marco { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; }
.flujo-cabeza { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s5); }
.flujo-marca { display: flex; align-items: center; gap: var(--s3); }
.flujo-marca img { width: 28px; height: auto; }
.flujo-cerrar { width: 48px; height: 48px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: inherit; }
.flujo-pasos { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); padding: 0 var(--s5) var(--s4); }
.flujo-pasos li { display: grid; gap: var(--s1); font-size: var(--fs-small); line-height: 1.2; opacity: .6; }
.flujo-pasos li.hecho, .flujo-pasos li[aria-current] { opacity: 1; }
.flujo-cuerpo { overflow-y: auto; padding: var(--s5); display: grid; gap: var(--s4); align-content: start; outline: none; }
.flujo-cuerpo h2:focus { outline: none; }
.flujo-resumen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s4); padding: var(--s3) var(--s4); background: var(--cal-sombra); font-size: var(--fs-small); }
.flujo-resumen span:first-child { font-weight: 600; }
.flujo-link { min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; justify-self: start; }
.flujo-resumen .flujo-link { margin-left: auto; min-height: 32px; }
.flujo-ayuda, .flujo-aviso { color: var(--texto-2); }
.flujo-aviso { padding: var(--s3) var(--s4); border-left: 3px solid var(--chin-seco); background: #fff; }
.flujo-form { display: grid; gap: var(--s4); }
.flujo-form textarea { width: 100%; min-height: 96px; padding: var(--s3); border: 1.5px solid rgba(42, 28, 21, .45); border-radius: 0; background: #fff; resize: vertical; }
.opcional { font-weight: 400; color: var(--texto-2); }
.flujo-acciones { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: flex-end; }
.flujo-acciones .btn { flex: 1 1 200px; }
.flujo-acciones-fija { position: sticky; bottom: calc(var(--s5) * -1); margin: 0 calc(var(--s5) * -1) calc(var(--s5) * -1); padding: var(--s4) var(--s5); background: inherit; border-top: 1px solid var(--linea); justify-content: space-between; background: var(--cal); }
.flujo-cap { font-size: var(--fs-small); font-weight: 600; flex: 1 1 160px; }
.btn[disabled] { background: #A79C90; cursor: not-allowed; }
.hab-ops { display: grid; gap: var(--s2); }
.hab-op label { display: grid; grid-template-columns: 72px minmax(0, 1fr) 24px; gap: var(--s4); align-items: center; padding: var(--s3); cursor: pointer; background: #fff; border: 1.5px solid var(--linea); transition: background .2s, border-color .2s; }
.hab-op input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hab-op label:has(input:focus-visible) { outline: 3px solid var(--accion); outline-offset: 2px; }
.hab-op-trama { position: relative; width: 72px; height: 72px; }
.hab-op-info { display: grid; gap: 2px; min-width: 0; }
.hab-op-cap { font-size: var(--fs-small); font-weight: 600; }
.hab-op-rasgo { font-size: var(--fs-small); color: var(--texto-2); }
.hab-op-nota { font-size: var(--fs-small); color: var(--madera); }
.hab-op-marca { width: 24px; height: 24px; border: 2px solid var(--madera-osc); display: grid; place-items: center; }
.hab-op.sel .hab-op-marca { background: var(--madera-osc); }
.hab-op.sel .hab-op-marca::after { content: ""; width: 10px; height: 6px; border: solid var(--cal); border-width: 0 0 2.5px 2.5px; transform: translate(0, -2px) rotate(-45deg); }
.flujo-listo { display: grid; gap: var(--s4); }
.flujo-listo-trama { height: 96px; margin: calc(var(--s5) * -1) calc(var(--s5) * -1) 0; }
.flujo-dl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s5); }
.flujo-dl dt { font-size: var(--fs-small); color: var(--texto-2); }
.flujo-dl dd { font-weight: 600; }
.flujo-dl > div:first-child { grid-column: 1 / -1; }
.flujo-prototipo { padding: var(--s3) var(--s4); border: 1.5px dashed var(--madera); font-size: var(--fs-small); }
.flujo-pie { padding: var(--s3) var(--s5) calc(var(--s3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); font-size: var(--fs-small); }
.flujo-pie a { font-weight: 600; }
