/* ==========================================================================
   TEMPLANDO EL ACERO — hoja de estilos
   Identidad: papel blanco editorial · tinta negra · rojo de la casa · cobre.
   Cabecera y pie en negro (donde vive el logotipo), contenido en blanco.
   ========================================================================== */

/* ------------------------------ Variables ------------------------------ */
:root {
  --paper:    #ffffff;
  --paper-2:  #f7f6f4;   /* off-white cálido para secciones alternas */
  --paper-3:  #efedea;   /* relleno de portadas / placeholders */
  --ink:      #15171a;   /* texto principal */
  --ink-2:    #3d434b;   /* texto secundario */
  --muted:    #6c727c;   /* texto terciario */
  --line:     #e2e0dc;   /* filetes */
  --line-2:   #cfccc6;   /* filetes marcados */
  --black:    #0f1012;   /* cabecera / pie */
  --black-2:  #1b1d20;

  --red:      #9e1b2f;   /* rojo de la casa */
  --red-2:    #7c1224;   /* rojo oscuro (hover) */
  --red-3:    #c02a3d;   /* rojo claro sobre negro */
  --red-tint: #fdf3f4;
  --copper:   #b08a4e;   /* cobre, solo sobre negro */

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-w: 1220px;
  --radius: 8px;
  --radius-s: 5px;
  --header-h: 78px;
  --topbar-h: 38px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --shadow-s: 0 1px 2px rgba(20,22,26,.06), 0 2px 8px rgba(20,22,26,.05);
  --shadow-m: 0 8px 28px rgba(20,22,26,.10);
  --shadow-l: 0 18px 60px rgba(20,22,26,.16);
}

/* ------------------------------ Reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
/* Debe ganar a cualquier display de componente (modal, carrito, botones…). */
[hidden] { display: none !important; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-2); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .45em; color: var(--ink); letter-spacing: -.005em; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
strong { font-weight: 600; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .86em; background: var(--paper-2); border: 1px solid var(--line); padding: .18em .45em; border-radius: 4px; color: var(--ink); }
.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; }
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); }
.muted { color: var(--muted); font-size: .93rem; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------ Utilidades ----------------------------- */
.kicker {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--red); margin: 0 0 .9em; font-weight: 600; font-family: var(--sans);
  display: flex; align-items: center; gap: .6em;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--red); display: block; flex: none; }
.text-link { border-bottom: 1px solid rgba(158,27,47,.32); transition: border-color .2s var(--ease), color .2s var(--ease); }
.text-link:hover { border-color: var(--red); }
.section { padding-block: clamp(60px, 7.5vw, 104px); }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.section-sub { max-width: 62ch; color: var(--ink-2); font-size: 1.02rem; margin-bottom: 2em; }
.section-head { margin-bottom: clamp(28px, 4vw, 46px); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Aparición al hacer scroll — rápida (0,35 s) para no dejar huecos vacíos */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-visible { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ------------------------------ Botones -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .82em 1.5em; border-radius: var(--radius-s); cursor: pointer;
  font: 600 .9rem/1.15 var(--sans); letter-spacing: .01em; text-align: center;
  border: 1.5px solid transparent; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
  min-height: 44px;
}
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-2); border-color: var(--red-2); color: #fff; box-shadow: 0 6px 18px rgba(158,27,47,.24); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: #000; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: var(--paper-2); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: transparent; padding-inline: .7em; }
.btn-quiet:hover { color: var(--red); }
.btn-small { padding: .6em 1.05em; font-size: .84rem; min-height: 40px; }
.btn-xs { padding: .52em .9em; font-size: .8rem; min-height: 38px; }
.btn-lg { padding: 1.02em 1.7em; font-size: 1rem; min-height: 52px; }
.btn-block { width: 100%; }
.btn-disabled, .btn[disabled] { background: var(--paper-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; box-shadow: none; }
@media (max-width: 768px) { .btn-xs, .btn-small { min-height: 44px; } }

/* ------------------------------ Cabecera ------------------------------- */
.topbar {
  background: linear-gradient(90deg, rgba(158,27,47,.16), rgba(158,27,47,0) 24%, rgba(158,27,47,0) 76%, rgba(158,27,47,.16)), var(--black-2); color: #a9a5a0; font-size: .78rem; letter-spacing: .012em;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 0 clamp(14px, 2.4vw, 28px); min-height: var(--topbar-h); padding-block: 7px; text-align: center;
}
.topbar-inner > span { display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; position: relative; }
/* Separadores de filete: sustituyen al banner rotativo anterior. */
.topbar-inner > span + span::before {
  content: ""; position: absolute; left: calc(clamp(14px, 2.4vw, 28px) / -2);
  top: 50%; height: 11px; width: 1px; margin-top: -5.5px; background: rgba(255,255,255,.16);
}
.topbar b { color: #ebe8e4; font-weight: 500; }
.topbar a { color: #ebe8e4; }
.topbar a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
/* Formas cortas: en pantallas estrechas la barra cabe en una sola línea. */
.tb-short { display: none; }
@media (max-width: 700px) {
  .topbar { font-size: .74rem; }
  .topbar-inner { min-height: var(--topbar-h); padding-block: 5px; gap: 0 16px; }
  .topbar-inner > .tb-ship, .topbar-inner .tb-long { display: none; }
  .topbar-inner .tb-short { display: inline; }
  /* Al ocultarse el primer dato, el filete separador sobrante desaparece. */
  .topbar-inner > .tb-ship + span::before { display: none; }
}

/* Banner rotativo (lo monta ui.js sobre la línea estática): un mensaje cada
   vez, con relevo suave. Fondo con leve profundidad para distinguirlo de una
   línea estática; icono por mensaje y barras de progreso en los indicadores. */
.promo-strip {
  position: relative; display: grid; place-items: center; min-height: var(--topbar-h); width: 100%;
}
.promo {
  grid-area: 1 / 1; display: flex; align-items: center; gap: 16px; justify-content: center;
  opacity: 0; transform: translateY(7px) scale(.99); pointer-events: none; text-align: center; flex-wrap: wrap;
  transition: opacity .38s var(--ease), transform .38s var(--ease); padding-block: 7px;
}
.promo.is-on { opacity: 1; transform: none; pointer-events: auto; }
.promo-text { display: inline-flex; align-items: center; gap: .6em; white-space: nowrap; }
.promo-icon {
  flex: none; width: 22px; height: 22px; padding: 4px; box-sizing: border-box; border-radius: 50%;
  background: rgba(224,79,79,.16); color: var(--red-3);
}
.promo .p-short { display: none; }
.promo-cta {
  font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: .3em .9em; white-space: nowrap; transition: background .2s var(--ease), border-color .2s var(--ease);
}
.promo-cta:hover { background: var(--red-3); border-color: var(--red-3); color: #fff; }
.promo-dots { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.promo-dots button {
  position: relative; width: 22px; height: 3px; padding: 0; border: 0; border-radius: 2px; overflow: hidden;
  background: rgba(255,255,255,.2); cursor: pointer;
}
.promo-dots button .bar { position: absolute; inset: 0; width: 0; background: var(--red-3); border-radius: inherit; }
.promo-dots button[aria-current="true"] .bar { animation: promoFill 2.5s linear forwards; }
.promo-strip.is-paused .promo-dots button[aria-current="true"] .bar { animation-play-state: paused; }
@keyframes promoFill { from { width: 0; } to { width: 100%; } }
@media (max-width: 820px) { .promo-dots { display: none; } }
@media (max-width: 700px) {
  /* En móvil: mensaje corto, sin enlace; si no cabe en una línea, salta a dos
     sin cortarse (la barra crece lo justo). */
  .promo .p-long, .promo .promo-cta { display: none; }
  .promo .p-short { display: inline; }
  .promo { gap: 8px; padding-block: 5px; padding-inline: 12px; }
  .promo-text { white-space: normal; text-align: center; line-height: 1.35; }
  .promo-icon { width: 18px; height: 18px; padding: 3px; }
}

.site-header { position: sticky; top: 0; z-index: 60; background: var(--black); border-bottom: 1px solid rgba(255,255,255,.10); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; }
/* El archivo del logotipo tiene fondo negro: sobre la banda negra encaja
   exactamente. Sin efectos al pasar el cursor. */
.brand-logo { height: 64px; width: auto; display: block; }
@media (max-width: 560px) { .brand-logo { height: 50px; } }

.main-nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.main-nav a { color: #cfcbc5; font-size: .89rem; font-weight: 500; letter-spacing: .015em; padding: 8px 0; position: relative; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; opacity: 0; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: #fff; }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { opacity: 1; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-s);
  color: #fff; cursor: pointer; position: relative; transition: border-color .2s var(--ease), background .2s var(--ease);
}
.icon-btn:hover { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.06); }
.icon-btn .count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--red-3); color: #fff; border-radius: 999px; font: 600 .7rem/20px var(--sans);
  text-align: center; opacity: 0;
}
.icon-btn.has-items .count { opacity: 1; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 20px; height: 2px; background: #fff; display: block; transition: transform .25s var(--ease), opacity .25s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1040px) {
  .nav-toggle { display: inline-flex; }
  /* El menú cuelga del borde inferior de la cabecera (que es sticky), así que
     queda bien colocado tanto arriba como con la página desplazada. */
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--black);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px clamp(20px,4vw,40px) 26px;
    border-bottom: 1px solid rgba(255,255,255,.12); box-shadow: 0 18px 40px rgba(0,0,0,.35);
    transform: translateY(-8px); opacity: 0;
    pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .main-nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1rem; }
  .main-nav a::after { display: none; }
}

/* ------------------------------ Hero ----------------------------------- */
.hero { padding-block: clamp(52px, 7vw, 96px) clamp(44px, 6vw, 78px); background: var(--paper); position: relative; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-title { font-size: clamp(2.6rem, 5.6vw, 4.15rem); line-height: 1.02; margin-bottom: .3em; letter-spacing: -.015em; }
.hero-title em { font-style: italic; color: var(--red); }
.hero-sub { font-size: clamp(1.02rem, 1.4vw, 1.16rem); color: var(--ink-2); max-width: 54ch; margin-bottom: 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 2.2em; }
/* Los rótulos no se parten: si no caben los dos, el segundo baja de fila. */
.hero-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.hero-stats { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 42px); margin: 0; padding-top: 26px; border-top: 1px solid var(--line); }
.hero-stats div { margin: 0; }
.hero-stats dt { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1; color: var(--ink); }
.hero-stats dd { margin: .35em 0 0; font-size: .84rem; color: var(--muted); letter-spacing: .01em; }

/* Carrusel 3D de los títulos más vendidos */
.hero-carousel { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.carousel-kicker { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.carousel-stage {
  width: 100%; height: clamp(230px, 30vw, 320px); perspective: 1150px; perspective-origin: 50% 46%;
  overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.carousel-stage.dragging { cursor: grabbing; }
.carousel-ring { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; will-change: transform; }
.carousel-item {
  position: absolute; top: 50%; left: 50%; width: 132px; margin: -92px 0 0 -66px;
  backface-visibility: hidden; border-radius: 3px; overflow: hidden; background: var(--paper-3);
  box-shadow: 0 14px 34px rgba(20,22,26,.26); outline-offset: 3px;
  -webkit-user-drag: none; user-select: none;
}
.carousel-item img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.carousel-item::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(20,22,26,.10); border-radius: 3px; }
.carousel-item.is-front { box-shadow: 0 22px 48px rgba(20,22,26,.34); }
.carousel-caption { margin: 0; text-align: center; min-height: 3.2em; display: flex; flex-direction: column; gap: 2px; }
.carousel-caption .c-title { font-family: var(--serif); font-size: 1.12rem; line-height: 1.2; color: var(--ink); }
.carousel-caption .c-title:hover { color: var(--red); }
.carousel-caption .c-meta { font-size: .82rem; color: var(--muted); }
.carousel-caption .c-meta b { color: var(--ink); font-weight: 600; }
.carousel-nav { display: flex; align-items: center; gap: 14px; }
.carousel-btn {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2);
  color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; transition: all .2s var(--ease);
}
.carousel-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.carousel-hint { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) { .hero-carousel { max-width: 520px; margin-inline: auto; } }
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-covers { max-width: 420px; }
}

/* Barra de confianza */
.trust-bar { background: var(--paper-2); border-block: 1px solid var(--line); }
.trust-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.trust-list li { padding: 20px clamp(12px, 2vw, 26px); display: flex; gap: 12px; align-items: flex-start; border-left: 1px solid var(--line); }
.trust-list li:first-child { border-left: 0; }
.trust-list b { display: block; font-size: .93rem; font-weight: 600; }
.trust-list span { font-size: .82rem; color: var(--muted); line-height: 1.45; }
.trust-list svg { flex: none; width: 20px; height: 20px; color: var(--red); margin-top: 2px; }
@media (max-width: 880px) { .trust-list { grid-template-columns: repeat(2, 1fr); } .trust-list li:nth-child(3) { border-left: 0; } .trust-list li:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 520px) { .trust-list { grid-template-columns: 1fr; } .trust-list li { border-left: 0; border-top: 1px solid var(--line); } .trust-list li:first-child { border-top: 0; } }

/* --------------------- Empieza por aquí (itinerarios) ------------------ */
.rail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.rail-card {
  display: flex; flex-direction: column; gap: 8px; padding: 24px 22px 22px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
  position: relative; overflow: hidden;
}
.rail-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); transform: scaleY(0); transform-origin: top; transition: transform .25s var(--ease); }
.rail-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-m); transform: translateY(-3px); color: var(--ink); }
.rail-card:hover::before { transform: scaleY(1); }
.rail-num { font: 600 .72rem/1 var(--sans); letter-spacing: .18em; color: var(--red); }
.rail-card h3 { font-size: 1.22rem; margin: 0; }
.rail-card p { font-size: .89rem; color: var(--muted); margin: 0; }
.rail-card .go { margin-top: auto; padding-top: 14px; font-size: .84rem; font-weight: 600; color: var(--ink); display: inline-flex; gap: 6px; }
.rail-card:hover .go { color: var(--red); }
@media (max-width: 900px) { .rail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .rail-grid { grid-template-columns: 1fr; } }
/* Entrada al hacer scroll: leve baja con giro 3D, en cascada de izquierda a
   derecha. La animación manda sobre el reveal genérico y no toca el hover. */
.rail-card.reveal.is-visible { animation: railIn .6s var(--ease) backwards; }
.rail-grid .rail-card:nth-child(2).is-visible { animation-delay: .09s; }
.rail-grid .rail-card:nth-child(3).is-visible { animation-delay: .18s; }
.rail-grid .rail-card:nth-child(4).is-visible { animation-delay: .27s; }
@keyframes railIn {
  from { opacity: 0; transform: perspective(900px) translateY(22px) rotateX(6deg) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------ Editorial ------------------------------ */
.grid-2 { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: clamp(28px, 5vw, 72px); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.editorial-text p { color: var(--ink-2); }
.editorial-text blockquote {
  margin: 1.8em 0 0; padding: 22px 26px; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-size: 1.28rem; font-style: italic; color: var(--ink); line-height: 1.4;
}
.editorial-text blockquote footer { font-family: var(--sans); font-size: .82rem; font-style: normal; color: var(--muted); margin-top: .7em; }

/* ------------------------------ Destacados (galería) ------------------- */
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.gallery-head h2 { margin-bottom: 0; }
.gallery-controls { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; }
.gallery-count { font-size: .78rem; letter-spacing: .16em; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery-btn {
  width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2);
  color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; transition: all .2s var(--ease);
}
.gallery-btn:hover:not(:disabled) { background: var(--ink); color: #fff; border-color: var(--ink); }
.gallery-btn:disabled { opacity: .35; cursor: default; }

/* Flechas laterales, a la altura de las piezas */
.gallery-wrap { position: relative; }
.gallery-side {
  position: absolute; top: clamp(150px, 17vw, 210px); z-index: 5; width: 48px; height: 48px;
  box-shadow: var(--shadow-m);
}
.gallery-side.prev { left: clamp(-22px, -1.6vw, -10px); }
.gallery-side.next { right: clamp(-22px, -1.6vw, -10px); }
.gallery-side:disabled { opacity: 0; pointer-events: none; }

.gallery-rail {
  display: flex; gap: clamp(22px, 3vw, 42px); overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding: 4px 2px 10px; margin-top: clamp(26px, 3.5vw, 44px);
  scrollbar-width: none; border-top: 1px solid var(--line);
}
.gallery-rail::-webkit-scrollbar { display: none; }
.plate { flex: 0 0 clamp(238px, 25vw, 292px); scroll-snap-align: start; display: flex; flex-direction: column; padding-top: clamp(26px, 3vw, 40px); position: relative; }
/* Marca de sala: el filete superior se prolonga sobre cada pieza */
.plate::before { content: ""; position: absolute; top: -1px; left: 0; width: 34px; height: 2px; background: var(--red); }
.plate-frame {
  display: block; background: #fff; border: 1px solid var(--line); padding: clamp(12px, 1.6vw, 18px);
  box-shadow: var(--shadow-s); transition: box-shadow .28s var(--ease), transform .28s var(--ease);
}
.plate:hover .plate-frame { box-shadow: var(--shadow-m); transform: translateY(-4px); }
.plate-frame img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; background: var(--paper-3); }
.plate-body { display: flex; flex-direction: column; flex: 1; padding-top: 18px; }
.plate-num { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.plate-body h3 { font-size: 1.24rem; line-height: 1.2; margin: .5em 0 .18em; }
.plate-body h3 a { color: var(--ink); }
.plate:hover h3 a { color: var(--red); }
.plate-author { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink-2); margin: 0 0 .7em; }
.plate-meta { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .9em; }
.plate-desc { font-size: .87rem; color: var(--muted); line-height: 1.55; margin: 0 0 1.2em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.plate-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plate-foot .price { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.gallery-hint { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 0; }

/* ------------------------------ Catálogo ------------------------------- */
.catalog-toolbar {
  display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(120px, 1fr));
  gap: 14px; align-items: end; padding: 22px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s);
  position: sticky; top: calc(var(--header-h) + 10px); z-index: 20;
}
@media (max-width: 1000px) { .catalog-toolbar { grid-template-columns: repeat(2, 1fr); position: static; } }
@media (max-width: 560px) { .catalog-toolbar { grid-template-columns: 1fr; padding: 16px; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .check-field { font-size: .76rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: .72em .85em; font: 400 .95rem/1.4 var(--sans); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--radius-s);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease); min-height: 46px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236c727c' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8em center; padding-right: 2.2em; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(158,27,47,.13); }
.field .hint { font-size: .78rem; color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); background: var(--red-tint); }
.field .err { font-size: .78rem; color: var(--red); font-weight: 500; letter-spacing: 0; text-transform: none; }
.check-field { display: flex; align-items: center; gap: 9px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500; color: var(--ink-2); min-height: 44px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--red); flex: none; }
.toolbar-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; margin-top: 16px; }
.results-count { font-size: .9rem; color: var(--muted); margin: 0; }
.results-count b { color: var(--ink); font-weight: 600; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 12px;
  background: var(--red-tint); border: 1px solid rgba(158,27,47,.22); color: var(--red-2);
  border-radius: 999px; font-size: .82rem; font-weight: 500; cursor: pointer;
}
.chip:hover { background: #fff; border-color: var(--red); }
.chip .x { font-size: 1.05rem; line-height: 1; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: clamp(18px, 2.2vw, 28px); margin-top: 30px; }
.book-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; position: relative;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.book-card:hover { box-shadow: var(--shadow-m); transform: translateY(-4px); border-color: var(--line-2); }
.book-card:focus-within { border-color: var(--red); }
.book-card .cover { position: relative; background: var(--paper-3); overflow: hidden; }
.book-card .cover img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; transition: transform .4s var(--ease); }
.book-card:hover .cover img { transform: scale(1.035); }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 9px; border-radius: 3px;
  background: var(--red); color: #fff; font: 600 .68rem/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase;
}
.badge.badge-dark { background: var(--ink); }
.badge.badge-ship { background: #1f6b46; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 18px; gap: 4px; }
.card-body .cat { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card-body h3 { font-size: 1.06rem; line-height: 1.24; margin: 0; }
.card-body h3 a { color: var(--ink); }
/* El título es el enlace real de la tarjeta: se estira sobre toda la portada,
   de modo que la tarjeta entera es clicable sin anidar controles. */
.card-body h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.book-card:hover h3 a { color: var(--red); }
.card-body .author { font-size: .84rem; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.price { font-family: var(--serif); font-size: 1.24rem; font-weight: 600; color: var(--ink); }
/* Ofertas: precio anterior tachado en gris, nuevo precio en tinta. */
.price-was { font-size: .78em; font-weight: 400; color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(158,27,47,.55); margin-right: .1em; font-family: var(--sans); }
.save-chip {
  display: inline-block; padding: 3px 9px; border-radius: 3px; background: var(--red-tint);
  border: 1px solid rgba(158,27,47,.25); color: var(--red-2); font: 600 .74rem/1.5 var(--sans); letter-spacing: .03em;
}
.offer-note { font-size: .84rem; color: var(--red-2); margin: 6px 0 0; font-weight: 500; }

/* --------- Etiquetas de oferta: brillo periódico y pulso sutil ----------- */
.offer-pill {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 10px; border-radius: 999px;
  background: var(--red); color: #fff; font: 700 .62rem/1.5 var(--sans); letter-spacing: .12em; text-transform: uppercase;
}
.badge-offer, .offer-pill, .save-chip, .pack-badge { position: relative; overflow: hidden; }
.badge-offer::after, .offer-pill::after, .save-chip::after, .pack-badge::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-140%) skewX(-18deg);
  animation: offerShine 3.8s ease-in-out infinite;
}
.offer-pill, .pack-badge { animation: offerPulse 2.6s ease-in-out infinite; }
@keyframes offerShine {
  0%, 78% { transform: translateX(-140%) skewX(-18deg); }
  100% { transform: translateX(320%) skewX(-18deg); }
}
@keyframes offerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ------------------------------ Packs ------------------------------------ */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.pack-card {
  display: flex; flex-direction: column; background: var(--paper-2, #fff); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; box-shadow: 0 10px 28px rgba(20,22,26,.07);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pack-card:hover { transform: translateY(-4px); box-shadow: 0 16px 38px rgba(20,22,26,.13); }
.pack-covers {
  position: relative; height: 205px; background:
    radial-gradient(120% 130% at 50% 0%, rgba(158,27,47,.12), transparent 55%), var(--ink);
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.pack-covers img {
  width: 108px; height: 151px; object-fit: cover; border-radius: 3px; margin-bottom: -14px;
  box-shadow: 0 12px 26px rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.16);
  transition: transform .35s var(--ease);
}
.pack-covers .pc-1 { transform: rotate(-9deg) translate(26px, 6px); }
.pack-covers .pc-2 { transform: rotate(0deg) translateY(-6px); z-index: 2; }
.pack-covers .pc-3 { transform: rotate(9deg) translate(-26px, 6px); }
.pack-card:hover .pc-1 { transform: rotate(-11deg) translate(30px, 4px); }
.pack-card:hover .pc-2 { transform: rotate(0) translateY(-12px); }
.pack-card:hover .pc-3 { transform: rotate(11deg) translate(-30px, 4px); }
.pack-badge {
  position: absolute; top: 12px; right: 12px; z-index: 3; padding: 6px 11px; border-radius: 999px;
  background: var(--red); color: #fff; font: 700 .8rem/1.2 var(--sans); letter-spacing: .06em;
  box-shadow: 0 6px 16px rgba(158,27,47,.4);
}
.pack-body { display: flex; flex-direction: column; gap: 8px; padding: 24px 20px 20px; flex: 1; }
.pack-kicker { font: 600 .68rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--red-2); }
.pack-body h3 { margin: 0; font-size: 1.32rem; line-height: 1.2; }
.pack-desc { font-size: .9rem; color: var(--muted); margin: 0; }
.pack-list { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 3px; }
.pack-list li { font-size: .84rem; padding-left: 16px; position: relative; }
.pack-list li::before { content: "·"; position: absolute; left: 4px; color: var(--red); font-weight: 700; }
.pack-list a { color: var(--ink-2, inherit); }
.pack-list a:hover { color: var(--red); }
.pack-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.pack-price { font-size: 1.5rem; }
.pack-ship { margin: 0; font: 600 .76rem/1.4 var(--sans); color: #1f6b46; }
.pack-body .btn { margin-top: 10px; justify-content: center; }
@media (max-width: 640px) {
  .pack-grid { grid-template-columns: 1fr; }
  .pack-covers { height: 185px; }
}
.buy-price .price-was { font-size: .55em; }
.cart-savings dd, .cart-savings dt { color: var(--red-2) !important; font-weight: 600; }
.price small { font-family: var(--sans); font-size: .7rem; font-weight: 500; color: var(--muted); letter-spacing: .04em; display: block; }
.price-consult { font-size: .9rem; color: var(--muted); font-family: var(--sans); }
.card-actions { position: relative; z-index: 2; display: flex; gap: 8px; margin-top: 12px; }
.card-actions .btn { flex: 1; }
.cover-placeholder {
  display: flex; flex-direction: column; justify-content: center; gap: 10px; aspect-ratio: 400/560;
  padding: 22px 18px; background: linear-gradient(160deg, #1b1d20, #303338); color: #efece6; text-align: left;
}
.cover-placeholder .ph-title { font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; }
.cover-placeholder .ph-author { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--copper); }
.cover-placeholder::before { content: ""; width: 30px; height: 2px; background: var(--red-3); display: block; }

.empty-state { text-align: center; padding: 60px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); margin-top: 30px; }
.empty-glyph { font-size: 2.2rem; margin: 0 0 .3em; color: var(--line-2); }
.load-more-wrap { display: flex; justify-content: center; margin-top: 40px; }

/* ------------------------------ Ficha (modal) -------------------------- */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: clamp(12px, 4vw, 40px); }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,16,18,.6); backdrop-filter: blur(3px); animation: fade .2s var(--ease); }
.modal-panel {
  position: relative; width: min(940px, 100%); max-height: 90dvh; overflow-y: auto; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-l); animation: pop .22s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.99) } to { opacity: 1; transform: none } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.modal-body { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: clamp(20px, 3vw, 38px); padding: clamp(20px, 3vw, 34px); }
@media (max-width: 720px) { .modal-body { grid-template-columns: 1fr; } .modal-cover { max-width: 200px; } }
.modal-cover { border-radius: 4px; overflow: hidden; background: var(--paper-3); box-shadow: var(--shadow-m); align-self: start; }
.modal-cover img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; }
.modal-info .cat { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.modal-info h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); margin: .25em 0 .12em; }
.modal-info .author { font-size: 1rem; color: var(--ink-2); margin-bottom: 1em; }
.modal-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 1.3em; }
.modal-meta span { background: #fff; padding: 10px 12px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.modal-meta strong { font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; }
.modal-info .desc { color: var(--ink-2); }
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.2em; }
.modal-tags span { font-size: .78rem; padding: 4px 10px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

/* ------------------------------ Novedades ------------------------------ */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 28px); }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }
.news-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s var(--ease), transform .2s var(--ease); color: var(--ink); }
.news-card:hover { box-shadow: var(--shadow-m); transform: translateY(-3px); color: var(--ink); }
.news-img { aspect-ratio: 16/10; background: var(--paper-3); overflow: hidden; }
.news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-img.placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #1b1d20, #303338); color: var(--copper); font-family: var(--serif); font-size: 1.2rem; letter-spacing: .05em; }
.news-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.news-body time { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.news-body h3 { font-size: 1.16rem; line-height: 1.24; margin: .5em 0 .35em; }
.news-body p { font-size: .89rem; color: var(--muted); margin-bottom: 1em; }
.news-body .read { margin-top: auto; font-size: .84rem; font-weight: 600; color: var(--red); }
.news-more { margin-top: 2em; }

/* ------------------------------ Contacto ------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.08fr); gap: clamp(26px, 4vw, 52px); align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { display: grid; gap: 14px; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.contact-card h3 { font-size: .78rem; font-family: var(--sans); font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: .8em; }
.contact-card p { margin: 0 0 .4em; }
.contact-card p:last-child { margin-bottom: 0; }
.contact-card a { font-weight: 500; }
.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.copy-row code { font-size: .84rem; }
.contact-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-s); }
.contact-form h3 { font-size: 1.4rem; margin-bottom: .8em; }
.contact-form .field { margin-bottom: 16px; }
.form-legal { font-size: .82rem; color: var(--muted); margin: 4px 0 16px; display: flex; gap: 9px; align-items: flex-start; }
.form-legal input { width: 18px; height: 18px; accent-color: var(--red); flex: none; margin-top: 2px; }
.form-status { margin-top: 14px; padding: 13px 16px; border-radius: var(--radius-s); font-size: .9rem; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: #edf7f1; border: 1px solid #b9dfc9; color: #17603c; }
.form-status.err { background: var(--red-tint); border: 1px solid rgba(158,27,47,.25); color: var(--red-2); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ------------------------------ Pie ------------------------------------ */
.site-footer { background: var(--black); color: #b9b5ad; padding: clamp(44px, 6vw, 72px) 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(3, minmax(0,1fr)); gap: clamp(24px, 3vw, 44px); padding-bottom: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-logo { height: 62px; width: auto; margin-bottom: 16px; }
.footer-about p { font-size: .88rem; color: #8e8a83; max-width: 42ch; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.1em; }
.site-footer nav, .footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.site-footer a { color: #b9b5ad; font-size: .89rem; overflow-wrap: anywhere; max-width: 100%; }
.site-footer a:hover { color: #fff; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: space-between; }
.footer-legal p { margin: 0; font-size: .82rem; color: #7d7a74; }
.footer-legal nav { flex-direction: row; flex-wrap: wrap; gap: 18px; }
.footer-legal a { font-size: .82rem; }
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pay-methods span { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: #8e8a83; border: 1px solid rgba(255,255,255,.16); border-radius: 3px; padding: 4px 8px; }
.site-footer.slim { padding-top: 0; }

/* ------------------------------ Carrito -------------------------------- */
.cart-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 58px; height: 58px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 0; cursor: pointer; display: none;
  align-items: center; justify-content: center; box-shadow: var(--shadow-l);
  transition: transform .25s var(--ease), background .2s var(--ease);
}
.cart-fab.has-items { display: flex; }
.cart-fab:hover { background: var(--red); transform: translateY(-3px); }
.cart-fab-count { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 6px; background: var(--red); color: #fff; border: 2px solid #fff; border-radius: 999px; font: 600 .74rem/20px var(--sans); }
.cart-fab.bump { animation: bump .4s var(--ease); }
@keyframes bump { 0%,100% { transform: scale(1) } 35% { transform: scale(1.14) } }

.cart-drawer { position: fixed; inset: 0; z-index: 95; }
.cart-backdrop { position: absolute; inset: 0; background: rgba(15,16,18,.5); opacity: 0; transition: opacity .28s var(--ease); }
.cart-drawer.open .cart-backdrop { opacity: 1; }
.cart-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(430px, 100%); background: #fff;
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .3s var(--ease); box-shadow: var(--shadow-l);
}
.cart-drawer.open .cart-panel { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 1.35rem; }
.cart-close { width: 40px; height: 40px; border-radius: 50%; background: transparent; border: 1px solid var(--line); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink); }
.cart-close:hover { background: var(--ink); color: #fff; }
.cart-items { list-style: none; margin: 0; padding: 12px 22px; overflow-y: auto; flex: 1; }
.cart-line { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-thumb { border-radius: 3px; overflow: hidden; background: var(--paper-3); box-shadow: 0 2px 8px rgba(20,22,26,.14); border: 1px solid var(--line); }
.cart-thumb img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; display: block; max-height: 92px; }
.cart-thumb-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 400/560; background: var(--ink); color: var(--copper); font-size: .7rem; letter-spacing: .1em; }
.cart-line-title { font-family: var(--serif); font-size: 1.02rem; line-height: 1.2; margin: 0 0 2px; }
.cart-line-title a { color: var(--ink); }
.cart-line-author, .cart-line-variant { font-size: .78rem; color: var(--muted); margin: 0; }
.cart-line-variant { color: var(--red); }
.cart-line-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; }
.qty-btn { width: 34px; height: 34px; background: #fff; border: 0; cursor: pointer; font-size: 1rem; color: var(--ink); }
.qty-btn:hover { background: var(--paper-2); color: var(--red); }
.qty-val { min-width: 30px; text-align: center; font-size: .9rem; font-weight: 600; }
.cart-line-price { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; }
.cart-remove { background: transparent; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }
.cart-remove:hover { background: var(--red-tint); color: var(--red); }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 24px; text-align: center; color: var(--muted); }
.cart-empty-glyph { font-size: 2rem; margin: 0; color: var(--line-2); }
.cart-foot { border-top: 1px solid var(--line); padding: 18px 22px 22px; background: var(--paper-2); }
.cart-totals { margin: 0 0 14px; display: grid; gap: 8px; }
.cart-totals div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.cart-totals dt { color: var(--ink-2); margin: 0; }
.cart-totals dd { margin: 0; font-weight: 600; }
.cart-totals .cart-total { border-top: 1px solid var(--line-2); padding-top: 10px; font-size: 1.06rem; }
.cart-totals .cart-total dd { font-family: var(--serif); font-size: 1.4rem; }
.cart-note { font-size: .78rem; color: var(--muted); margin: 0 0 12px; display: block; }
.cart-note.ok { color: #17603c; font-weight: 500; }
/* Barra de progreso hacia el envío gratuito */
.ship-bar { display: block; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 7px; }
.ship-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--red), var(--red-3)); transition: width .45s var(--ease); }
.ship-fill.done { background: #1f6b46; }
.ship-msg { display: block; font-size: .78rem; line-height: 1.4; }
.ship-msg b { color: var(--ink); font-weight: 600; }
.ship-msg.done { color: #17603c; font-weight: 500; }
.cart-manual-label { font-size: .78rem; color: var(--muted); text-align: center; margin: 14px 0 8px; }
.cart-manual { display: flex; gap: 8px; }
.cart-manual .btn { flex: 1; }
.cart-trust { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; font-size: .74rem; color: var(--muted); }

/* ------------------------------ Toast ---------------------------------- */
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); width: min(440px, calc(100vw - 32px)); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-card { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 13px 14px 13px 18px; border-radius: var(--radius); box-shadow: var(--shadow-l); font-size: .9rem; }
.toast-ico { width: 22px; height: 22px; border-radius: 50%; background: #1f6b46; display: grid; place-items: center; font-size: .78rem; flex: none; }
.toast-card span:nth-child(2) { flex: 1; }
.toast-cart { background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: var(--radius-s); padding: 7px 12px; font: 600 .8rem var(--sans); cursor: pointer; }
.toast-cart:hover { background: #fff; color: var(--ink); }

/* ------------------------------ Migas ---------------------------------- */
.breadcrumb { padding: 16px 0; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumb li::after { content: "›"; margin-left: 8px; color: var(--line-2); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red); }

/* ------------------------------ Ficha de libro ------------------------- */
.book-page { padding-block: clamp(30px, 4.5vw, 56px) clamp(50px, 6vw, 84px); }
.book-layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(28px, 4vw, 60px); align-items: start; }
@media (max-width: 900px) { .book-layout { grid-template-columns: 1fr; } .book-media { max-width: 300px; } }
.book-media { position: sticky; top: calc(var(--header-h) + 24px); }
.book-cover { border-radius: 4px; overflow: hidden; background: var(--paper-3); box-shadow: var(--shadow-l); }
.book-cover img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; }
.book-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin-bottom: .2em; }
.book-authorline { font-size: 1.06rem; color: var(--ink-2); margin-bottom: 1.2em; }
.book-authorline a { font-weight: 500; }
.buy-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-s); margin-bottom: 28px; }
.buy-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.buy-price .amount { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; line-height: 1; }
.buy-stock { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 500; color: #17603c; margin-bottom: 16px; }
.buy-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1f6b46; }
.buy-stock.pre { color: #8a5a12; } .buy-stock.pre::before { background: #c98a1f; }
.buy-stock.out { color: var(--muted); } .buy-stock.out::before { background: var(--line-2); }
.variant-list { display: grid; gap: 8px; margin: 0 0 16px; }
.variant-opt { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-s); cursor: pointer; font-size: .92rem; }
.variant-opt:hover { border-color: var(--ink); }
.variant-opt input { accent-color: var(--red); width: 18px; height: 18px; flex: none; }
.variant-opt:has(input:checked) { border-color: var(--red); background: var(--red-tint); }
.variant-opt .v-price { margin-left: auto; font-weight: 600; }
.variant-opt .v-note { display: block; font-size: .78rem; color: var(--muted); }
.buy-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.buy-actions .btn { flex: 1 1 180px; }
.buy-meta { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 7px; font-size: .84rem; color: var(--muted); }
.buy-meta span { display: flex; gap: 8px; align-items: flex-start; }
.buy-meta svg { width: 16px; height: 16px; color: var(--red); flex: none; margin-top: 3px; }
.book-section { margin-bottom: 30px; }
.book-section h2 { font-size: 1.5rem; margin-bottom: .5em; }
.book-section p { color: var(--ink-2); }
.spec-table { width: 100%; border-collapse: collapse; font-size: .92rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { font-weight: 500; color: var(--muted); width: 42%; background: var(--paper-2); }
.spec-table td { color: var(--ink); }
.info-note { background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--copper); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 16px 18px; font-size: .92rem; color: var(--ink-2); }
.info-note p:last-child { margin-bottom: 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }

/* ------------------------------ Documentos legales --------------------- */
.doc { padding-block: clamp(32px, 5vw, 64px) clamp(50px, 7vw, 90px); }
.doc-inner { max-width: 74ch; }
.doc h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: .3em; }
.doc .doc-updated { font-size: .84rem; color: var(--muted); margin-bottom: 2.4em; }
.doc h2 { font-size: 1.5rem; margin: 1.9em 0 .5em; }
.doc h3 { font-size: 1.12rem; font-family: var(--sans); font-weight: 600; margin: 1.5em 0 .4em; }
.doc p, .doc li { color: var(--ink-2); }
.doc ul, .doc ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.doc li { margin-bottom: .45em; }
.doc .toc { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 2.4em; }
.doc .toc ol { margin: 0; }
.doc-data { display: grid; gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.6em; }
.doc-data div { background: #fff; padding: 11px 16px; display: flex; gap: 14px; flex-wrap: wrap; font-size: .92rem; }
.doc-data dt { font-weight: 600; min-width: 190px; margin: 0; color: var(--ink); }
.doc-data dd { margin: 0; color: var(--ink-2); }
.todo { background: #fffbe9; border: 1px solid #efdca0; border-radius: var(--radius-s); padding: 3px 8px; font-size: .84rem; color: #7a5c07; font-weight: 600; }

/* ------------------------------ Checkout ------------------------------- */
.page-checkout { background: var(--paper-2); }
.checkout-wrap { padding-block: clamp(26px, 4vw, 46px) clamp(46px, 6vw, 76px); }
.checkout-head { margin-bottom: clamp(24px, 3vw, 38px); max-width: 62ch; }
.checkout-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }
.cform { border: 0; margin: 0 0 22px; padding: clamp(20px, 2.6vw, 28px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); }
.cform legend { float: left; width: 100%; font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--red); padding: 0 0 14px; }
.grid-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; clear: both; }
.grid-fields .field-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-fields { grid-template-columns: 1fr; } }
.checkout-notice { padding: 14px 18px; border-radius: var(--radius-s); font-size: .92rem; margin-bottom: 18px; }
.checkout-notice.warn { background: #fffbe9; border: 1px solid #efdca0; color: #7a5c07; }
.checkout-notice.err { background: var(--red-tint); border: 1px solid rgba(158,27,47,.25); color: var(--red-2); }
.checkout-notice.info { background: #eef4fb; border: 1px solid #c3d7ef; color: #1c4a80; }
.consent { display: flex; gap: 11px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); margin-bottom: 16px; }
.consent input { width: 19px; height: 19px; accent-color: var(--red); flex: none; margin-top: 2px; }
.trust-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 16px 0 0; margin: 0; font-size: .8rem; color: var(--muted); }
.manual-pay { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 28px); margin-top: 26px; }
.manual-pay h2 { font-size: 1.35rem; }
.manual-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.manual-info p { font-size: .9rem; margin-bottom: .5em; }
.checkout-summary { position: sticky; top: calc(var(--header-h) + 22px); }
.summary-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 2.6vw, 26px); box-shadow: var(--shadow-s); }
.summary-card h2 { font-size: 1.3rem; margin-bottom: .8em; }
.summary-items { display: grid; gap: 14px; margin-bottom: 18px; }
.sum-line { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; align-items: start; }
.sum-thumb { border-radius: 3px; overflow: hidden; background: var(--paper-3); }
.sum-thumb img { width: 100%; height: auto; aspect-ratio: 400/560; object-fit: cover; display: block; max-height: 62px; }
.sum-thumb span { display: grid; place-items: center; aspect-ratio: 400/560; background: var(--ink); color: var(--copper); font-size: .62rem; }
.sum-title { font-size: .92rem; font-weight: 500; margin: 0 0 2px; line-height: 1.3; }
.sum-qty { font-size: .8rem; color: var(--muted); margin: 0; }
.sum-price { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.summary-totals { border-top: 1px solid var(--line); padding-top: 14px; margin: 0; display: grid; gap: 9px; }
.summary-totals div { display: flex; justify-content: space-between; gap: 12px; font-size: .93rem; }
.summary-totals dt { margin: 0; color: var(--ink-2); }
.summary-totals dd { margin: 0; font-weight: 600; }
.summary-totals .grand { border-top: 1px solid var(--line-2); padding-top: 11px; }
.summary-totals .grand dd { font-family: var(--serif); font-size: 1.5rem; }
.summary-note { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.summary-edit { margin: 14px 0 0; font-size: .88rem; }
.back-link { font-size: .88rem; color: #d6d2ca; border-bottom-color: rgba(255,255,255,.28); }
.back-link:hover { color: #fff; }

/* ------------------------------ Éxito / cancelación -------------------- */
.result-page { min-height: 62dvh; display: grid; place-items: center; padding-block: clamp(40px, 7vw, 90px); }
.result-card { max-width: 620px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(30px, 5vw, 52px); box-shadow: var(--shadow-m); }
.result-ico { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 22px; font-size: 1.7rem; }
.result-ico.ok { background: #edf7f1; color: #17603c; }
.result-ico.warn { background: #fffbe9; color: #8a5a12; }
.order-ref { display: inline-block; margin: 6px 0 18px; padding: 10px 18px; background: var(--paper-2); border: 1px dashed var(--line-2); border-radius: var(--radius-s); font-family: ui-monospace, Menlo, monospace; font-size: 1rem; letter-spacing: .06em; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.next-steps { text-align: left; margin: 26px 0 0; padding: 20px 22px; background: var(--paper-2); border-radius: var(--radius); }
.next-steps ol { margin: 0; padding-left: 1.2em; }
.next-steps li { margin-bottom: .5em; font-size: .92rem; color: var(--ink-2); }
.next-steps h2 { font-size: 1.15rem; margin-bottom: .6em; }
/* Estados de la página de pago (comprobando · pagado · en proceso · error) */
.result-ico.wait { background: var(--paper-2); color: var(--ink-2); }
.result-ico .spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--ink);
  animation: teaSpin .9s linear infinite; display: block;
}
@keyframes teaSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .result-ico .spin { animation-duration: 3s; } }
.result-items { list-style: none; margin: 20px 0 0; padding: 0; text-align: left; border-top: 1px solid var(--line); }
.result-items li { display: flex; gap: 14px; justify-content: space-between; align-items: baseline;
  padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.result-items li b { white-space: nowrap; color: var(--ink); }
.result-total { margin-top: 14px; font-size: 1.02rem; }
.result-testmode { display: inline-block; margin: 4px 0 10px; padding: 6px 12px; border-radius: var(--radius-s);
  background: #fffbe9; border: 1px solid #e8d9a8; color: #8a5a12; font-size: .82rem; }

/* ==========================================================================
   AJUSTES MÓVILES — se aplican por encima de todo lo anterior.
   Referencia: 390 × 844 (iPhone 14) y 360 × 800 (Android medio).
   ========================================================================== */
@media (max-width: 700px) {
  :root { --header-h: 62px; --topbar-h: 32px; }

  /* Cabecera compacta: logotipo legible y dos objetivos táctiles de 44 px. */
  .brand-logo { height: 42px; }
  .header-actions { gap: 8px; }

  /* Hero */
  .kicker { font-size: .68rem; letter-spacing: .15em; }
  .hero { padding-block: 34px 40px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 1.8em; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 20px; }
  .hero-stats dt { font-size: 1.5rem; }
  .hero-stats dd { font-size: .74rem; line-height: 1.35; }
  .carousel-btn { width: 44px; height: 44px; }

  /* Itinerarios: tarjetas ajustadas al contenido, sin huecos muertos. */
  .rail-card { padding: 18px 18px 16px; gap: 6px; }
  .rail-card h3 { font-size: 1.12rem; }
  .rail-card p { font-size: .86rem; }
  .rail-card .go { margin-top: 4px; padding-top: 10px; }

  /* Sala de destacados: cabecera en dos filas y una pieza por pantalla. */
  .gallery-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .gallery-controls { padding-bottom: 0; }
  .plate { flex: 0 0 76%; padding-top: 22px; }
  .plate-body h3 { font-size: 1.14rem; }
  /* Flechas laterales también en móvil: dentro de pantalla, sobre la pieza. */
  .gallery-side { width: 44px; height: 44px; top: 170px; }
  .gallery-side.prev { left: 2px; }
  .gallery-side.next { right: 2px; }

  /* Catálogo: buscador a todo lo ancho y los cuatro selectores en 2 × 2. */
  .catalog-toolbar { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px; }
  .catalog-toolbar .field:first-child { grid-column: 1 / -1; }
  .field label { font-size: .7rem; }
  .field input, .field select { min-height: 44px; padding: .6em .75em; font-size: .92rem; }

  /* Dos fichas por fila: el fondo se recorre en la mitad de pantallas. */
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
  .card-body { padding: 12px 12px 14px; }
  .card-body h3 { font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card-body .cat { font-size: .64rem; }
  .card-body .author { font-size: .78rem; }
  .card-foot { padding-top: 10px; }
  .price { font-size: 1.1rem; }
  .card-actions { flex-direction: column; gap: 6px; margin-top: 10px; }
  .card-actions .btn { width: 100%; }
  .badge { font-size: .6rem; padding: 3px 7px; top: 8px; left: 8px; }

  /* Ficha de libro: portada más pequeña, alineada al mismo eje que el texto. */
  .book-media { max-width: 230px; position: static; }
  .buy-box { padding: 18px; }
  .buy-price .amount { font-size: 2rem; }
  .buy-actions { flex-direction: column; }
  .buy-actions .btn { flex: 1 1 auto; width: 100%; }
  .spec-table { font-size: .88rem; }
  .spec-table th, .spec-table td { padding: 10px 12px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Pie y botón flotante del carrito */
  .footer-logo { height: 52px; }
  .cart-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .toast { bottom: 16px; }
}

/* Móviles estrechos (360 px): una sola columna de fichas para no apretar. */
@media (max-width: 374px) {
  .book-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}


/* ------------------- Selector de idioma y país (globo) ------------------- */
/* Vive en la cabecera, junto al carrito. El globo gira al cambiar y el
   contenido entra en cascada por bloques (ver .i18n-swap más abajo). */
.geo { position: relative; }
.geo-btn { display: inline-flex; align-items: center; gap: 6px; padding-inline: 8px; }
.geo-code { font: 600 .72rem/1 var(--sans); letter-spacing: .08em; }
.geo-globe { flex: none; width: 20px; height: 20px; transform-style: preserve-3d; }
.geo-btn.is-spin .geo-globe { animation: geoSpin .9s cubic-bezier(.45,0,.2,1); }
@keyframes geoSpin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.geo-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 80; width: min(320px, calc(100vw - 32px));
  background: var(--black-2); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-s);
  box-shadow: 0 24px 60px rgba(0,0,0,.45); padding: 14px; display: grid; gap: 8px;
  animation: geoPanelIn .22s var(--ease);
}
@keyframes geoPanelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.geo-h { margin: 0; font: 600 .68rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #8f8b86; }
.geo-langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.geo-lang {
  padding: 7px 4px; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; background: transparent;
  color: #d8d4d0; font: 500 .76rem/1.1 var(--sans); cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.geo-lang:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.geo-lang[aria-current="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.geo-select {
  width: 100%; padding: 9px 10px; border-radius: 4px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06); color: #ebe8e4; font: 500 .82rem/1.2 var(--sans); min-height: 40px;
}
.geo-select:focus-visible { outline: 2px solid var(--red-3); outline-offset: 1px; }
.geo-meta { margin: 2px 0 0; display: grid; gap: 3px; font-size: .73rem; line-height: 1.45; color: #a9a5a0; }
.geo-suggest button {
  width: 100%; margin-top: 2px; padding: 8px 10px; border: 1px solid var(--red-3); border-radius: 4px;
  background: rgba(224,79,79,.14); color: #fff; font: 600 .76rem/1.2 var(--sans); cursor: pointer;
}
.geo-suggest button:hover { background: var(--red); }
.geo-fx { display: block; font-size: .74rem; font-weight: 500; color: var(--muted); }
.geo-eta { display: block; margin-top: 3px; }
@media (max-width: 560px) {
  /* En móvil el panel se centra en pantalla, bajo la cabecera. */
  .geo-panel {
    position: fixed; top: var(--geo-top, 130px);
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - var(--geo-top, 130px) - 16px); overflow-y: auto;
  }
  @keyframes geoPanelIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
  .geo-langs { grid-template-columns: repeat(2, 1fr); }
  .geo-code { display: none; }
}

/* Cascada al cambiar idioma o país: los bloques salen a la vez y entran
   escalonados, con un leve desenfoque. Se anula con reduced-motion. */
[data-i18n-block] {
  transition: opacity .46s var(--ease) calc(var(--i, 0) * 70ms),
              transform .46s var(--ease) calc(var(--i, 0) * 70ms),
              filter .46s var(--ease) calc(var(--i, 0) * 70ms);
}
body.i18n-swap [data-i18n-block] {
  opacity: 0; transform: translateY(16px); filter: blur(4px);
  transition-duration: .16s; transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  body.i18n-swap [data-i18n-block] { opacity: 1; transform: none; filter: none; }
  .geo-btn.is-spin .geo-globe { animation: none; }
  .badge-offer::after, .offer-pill::after, .save-chip::after, .pack-badge::after { animation: none; }
  .offer-pill, .pack-badge { animation: none; }
}


/* --------------------------- Precarga de la web -------------------------- */
/* Entrada sobria de casa editorial: fondo tinta, logotipo que asienta,
   filete tipográfico que se traza y lema en versalitas. ~1,5 s por carga.
   IMPORTANTE: la salida la ejecuta el propio CSS. Aunque el JavaScript
   fallara, a los 2,1 s la capa deja de ver y de tocar la página, así que
   nunca puede dejar la web bloqueada. Tampoco se bloquea el scroll. */
.preloader {
  position: fixed; inset: 0; z-index: 2000; background: var(--black);
  display: grid; place-items: center;
  transition: opacity .55s var(--ease), visibility .55s;
  animation: preAuto .01s linear 2.1s forwards;   /* seguro sin JavaScript */
}
@keyframes preAuto { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; animation: none; }
.pre-inner { display: grid; justify-items: center; gap: 20px; padding: 24px; text-align: center; }
.pre-logo {
  width: min(320px, 68vw); height: auto; display: block;
  opacity: 0; animation: preLogo .7s var(--ease) .1s both;
}
@keyframes preLogo { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Filete de imprenta: se traza del centro hacia fuera. */
.pre-rule {
  display: block; height: 1px; width: min(230px, 52vw);
  background: linear-gradient(90deg, transparent, var(--copper, #b0876b) 18%, var(--copper, #b0876b) 82%, transparent);
  transform: scaleX(0); transform-origin: center;
  animation: preRule .9s var(--ease) .45s both;
}
@keyframes preRule { to { transform: scaleX(1); } }
.pre-word {
  font: 500 .66rem/1.6 var(--sans); letter-spacing: .3em; text-transform: uppercase;
  color: #b6b0a8; padding-left: .3em; /* compensa el letter-spacing final */
  opacity: 0; animation: preWord .7s var(--ease) .7s both;
}
@keyframes preWord { from { opacity: 0; transform: translateY(4px); } to { opacity: .95; transform: none; } }

/* Movimiento reducido: la precarga no se muestra. */
@media (prefers-reduced-motion: reduce) {
  .preloader { display: none !important; }
}
