/* ═══════════════════════════════════════════════════════════════════
   AnonimoDsn — Sistema de diseño compartido (v3, identidad «La etiqueta», 11 nov 2026)
   Tokens · Base · Navegación · Botones · Componentes · Movimiento
   Papel y tinta: crema papel, azul tinta y un solo acento terracota. Esquinas redondeadas, botones en píldora.
   Las franjas oscuras (pie, llamados) son de tinta y usan los mismos tokens con el ámbito .on-ink.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Cuatro tiradores de esquina del marco de selección */
  /* Superficies: papel crema y hoja */
  --bg: #F6EEDC;          /* Papel crema */
  --bg-2: #F0E6CF;        /* Papel más oscuro, para franjas alternas */
  --surface: #FCF8EE;     /* Hoja: tarjetas */
  --surface2: #F3EAD6;    /* Hoja sombreada: hover y paneles */
  --border: #DACFB6;
  --line: rgba(20,35,74,.13);
  --line-strong: rgba(20,35,74,.24);
  /* Texto: azul tinta */
  --text: #14234A;        /* Azul tinta, 13,3:1 sobre papel */
  --text-2: #2E3C63;
  --muted: #4B587A;       /* Pizarra, 6,1:1 sobre papel */
  --muted2: #C6B99C;
  /* Acento único: terracota */
  --accent: #AE4322;      /* Terracota, 5,0:1 sobre papel */
  --accent-h: #8F3518;
  --accent-ink: #FCF8EE;
  --accent-soft: rgba(174,67,34,.09);
  --accent-line: rgba(174,67,34,.40);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08  0 0 0 0 .14  0 0 0 0 .29  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --ink: #14234A;         /* Tinta: franjas oscuras */
  --arcilla: #E58A66;     /* Terracota sobre tinta */
  --chip: #F3D8C6;
  /* Tipografía */
  --font-disp: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; /* sin letra monoespaciada: las etiquetas van en Figtree */
  /* Forma y movimiento */
  --ease: cubic-bezier(.16,1,.3,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --ease-drawer: cubic-bezier(.32,.72,0,1); /* menú móvil y carrito: abren rápido y frenan largo */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --pill: 999px;
  /* Escala de capas */
  --z-nav: 900;
  --z-overlay: 1000;
  --z-modal: 1100;
  --z-toast: 1200;
  --z-progress: 1300;
}

/* ── Franjas de tinta: pie y llamados. Mismos tokens, valores para fondo oscuro ── */
.on-ink, footer, .ft, .pg-cta-box, .case-hero, .loc-hero, .cta-box {
  --bg: #14234A; --bg-2: #1A2C5C; --surface: #1D3066; --surface2: #243974;
  --border: rgba(252,248,238,.22); --line: rgba(252,248,238,.16); --line-strong: rgba(252,248,238,.30);
  --text: #FCF8EE; --text-2: #EDE4CF; --muted: #D3CCBB; --muted2: #8C94AE;
  --accent: #E58A66; --accent-h: #F3A486; --accent-ink: #14234A;
  --accent-soft: rgba(229,138,102,.14); --accent-line: rgba(229,138,102,.45);
  background: var(--bg); color: var(--text);
}

/* ═════════ Identidad A · La etiqueta (11 nov 2026) ═════════
   Etiqueta «Hola, soy …»: pegatina de tinta con el filete de arcilla y la esquina despegada en terracota.
   El fondo es un SVG propio (mismo trazado que el símbolo), así se estira solo en alto y largo fijos por tamaño. */
.tag-hs {
  --h: 64px; position: relative; display: inline-flex; flex-direction: column; justify-content: center; vertical-align: middle;
  width: calc(var(--h) * 3.15); height: var(--h); padding: 0 calc(var(--h) * .3) 0 calc(var(--h) * .26);
  background: url("../../logo/etiqueta-tinta.svg") center / 100% 100% no-repeat; color: #FCF8EE; white-space: nowrap;
  transform: rotate(-2deg); filter: drop-shadow(0 calc(var(--h) * .09) calc(var(--h) * .12) rgba(20,35,74,.28));
  user-select: none; pointer-events: none;
}
.tag-hs small { font: 800 calc(var(--h) * .145)/1 var(--font-body); letter-spacing: .17em; text-transform: uppercase; color: var(--arcilla); margin-bottom: calc(var(--h) * .06); }
.tag-hs b { font: italic 580 calc(var(--h) * .36)/1.05 var(--font-disp); letter-spacing: -.01em; color: #FCF8EE; }
.tag-hs--hoja { background-image: url("../../logo/etiqueta-hoja.svg"); color: var(--ink); }
.tag-hs--hoja small { color: #AE4322; }
.tag-hs--hoja b { color: var(--ink); }
.tag-hs--vacio b { color: #4B587A; }
.tag-hs small { font-size: max(9px, calc(var(--h) * .145)); }

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg) var(--grain); color: var(--text);
  font-family: var(--font-body); font-size: 16px;
  line-height: 1.6; font-kerning: normal;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3 { text-wrap: balance; }
h1, h2, h3, h4 { font-family: var(--font-disp); font-weight: 600; letter-spacing: -.012em; }
p, li { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
::placeholder { color: var(--muted); opacity: 1; }
input, select, textarea, button { font-family: inherit; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:not([class]) { text-underline-offset: 3px; }
a:hover { color: var(--accent-h); }
ul, ol { list-style: none; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Enlace de salto y foco ── */
.skip-link {
  position: absolute; top: -48px; left: 12px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 18px; font-weight: 700; font-size: .85rem;
  font-family: var(--font-body); z-index: var(--z-progress);
  border-radius: 0 0 8px 8px; transition: top .2s; text-decoration: none;
}
.skip-link:focus { top: 0; color: var(--accent-ink); }
.skip-link:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── Barra de progreso ── */
#progress {
  position: fixed; top: 0; left: 0; z-index: var(--z-progress);
  height: 2px; width: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
}

/* La barra sigue el scroll desde el CSS donde se puede; si no, main.js le cambia la escala */
@supports (animation-timeline: scroll()) {
  #progress { animation: progressFill linear both; animation-timeline: scroll(root); }
}
@keyframes progressFill { to { transform: scaleX(1); } }

/* ── Layout ── */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }

/* ── Navegación ── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  padding: 16px 0; border-bottom: 1px solid var(--line); background: rgba(246,238,220,.94);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: background .35s, border-color .35s;
}
#nav.glass {
  background: rgba(246,238,220,.86);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-color: var(--line); padding: 11px 0;
}
.nav-inner { display: flex; align-items: center; gap: 28px; }
/* Carrito mini del menú (todas las páginas menos la portada, que tiene el carrito completo) */
.cart-btn-mini { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: none; color: var(--text); cursor: pointer; transition: border-color .25s, color .25s; }
.cart-btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.cart-badge-mini { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 700 .62rem var(--font-mono); display: none; align-items: center; justify-content: center; }
.nav-logo { display: flex; flex-shrink: 0; align-items: center; min-height: 40px; }
.nav-logo svg { height: 30px; width: auto; display: block; }
.nav-logo-img { height: 38px; width: auto; display: block; max-width: 340px; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a { position: relative; font-size: .82rem; font-weight: 500; color: var(--muted); transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover::after { transform: scaleX(1); } }
.nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-actions .magnetic { display: inline-flex; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: .88rem; padding: 10px 20px; border-radius: var(--pill);
  background: var(--accent); color: var(--accent-ink);
  transition: background .25s, box-shadow .25s, transform .25s var(--ease);
}
.nav-cta:hover { background: var(--accent-h); color: var(--accent-ink); }
.nav-cta:active { transform: scale(.98); }
/* Una sola fila en portátil/escritorio (reforzado con #nav para ganar al CSS inline de cada página) */
#nav .nav-links a, #nav .nav-cta { white-space: nowrap; }
#nav .nav-inner { gap: 20px; }
#nav .nav-links { gap: 2px; margin-left: auto; }
#nav .nav-links a { padding: 8px 8px; font-family: var(--font-body); font-size: .9rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
#nav .nav-links a::after { left: 8px; right: 8px; bottom: 3px; }
#nav .nav-links a:hover, #nav .nav-links a.active { color: var(--text); }
#nav .nav-cta, #nav .nav-cta.btn-fill { padding: 9px 20px; font-size: .88rem; background: transparent; color: var(--text); border: 1.5px solid var(--text); }
#nav .nav-cta:hover, #nav .nav-cta.btn-fill:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
@media (min-width: 769px) { #nav .nav-logo-img { height: 36px; } } /* el logo nuevo mide 7,6 veces su alto: 275 px de ancho */
/* Hamburguesa donde no cabe (5 enlaces caben desde 960px) */
@media (min-width: 769px) and (max-width: 959px) {
  #nav:has(#hamburger) .nav-links, #nav:has(#hamburger) .nav-cta { display: none; }
  #nav:has(#hamburger) .hamburger { display: flex; }
  #nav:has(#hamburger) .nav-logo { margin-right: auto; }
}
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  flex-shrink: 0; width: 44px; height: 44px; padding: 10px; background: none;
  border: none; cursor: pointer; border-radius: 50%;
}
/* Dos tiempos: las líneas se juntan al centro y luego giran a X (al cerrar, al revés) */
.hamburger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: translate .2s var(--ease) .18s, rotate .2s var(--ease), scale .2s var(--ease) .1s; }
.hamburger[aria-expanded="true"] span { transition: translate .2s var(--ease), rotate .26s var(--ease) .18s, scale .2s var(--ease); }
.hamburger[aria-expanded="true"] span:nth-child(1) { translate: 0 7px; rotate: 45deg; }
.hamburger[aria-expanded="true"] span:nth-child(2) { scale: 0 1; }
.hamburger[aria-expanded="true"] span:nth-child(3) { translate: 0 -7px; rotate: -45deg; }
/* Se revela en círculo desde la hamburguesa y se cierra hacia ella; visibility lo saca del foco cuando está cerrado */
#mobile-overlay {
  display: flex; visibility: hidden; position: fixed; inset: 0;
  background: var(--bg); z-index: var(--z-nav);
  flex-direction: column; align-items: center; gap: 32px;
  padding: 96px 24px 48px; overflow-y: auto;
  clip-path: circle(0 at calc(100% - 46px) 36px);
  transition: clip-path .3s cubic-bezier(.3,.6,.3,1) .05s, visibility 0s .35s;
}
#mobile-overlay.open { visibility: visible; clip-path: circle(142vmax at calc(100% - 46px) 36px); transition: clip-path .45s var(--ease-drawer), visibility 0s; }
#mobile-overlay::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 420px at 100% 0%, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
#mobile-overlay.open::before { opacity: 1; transition: opacity .9s var(--ease) .25s; }
/* Centrado con márgenes y no con justify-content: si el menú no cabe, se puede desplazar hasta el primer enlace */
#mobile-overlay > :first-child { margin-top: auto; }
#mobile-overlay > :last-child { margin-bottom: auto; }
@media (max-height: 720px) {
  #mobile-overlay { gap: 20px; padding: 80px 24px 24px; }
  #mobile-overlay .mobile-nav-links { gap: 6px; }
  #mobile-overlay .mobile-nav-links a { font-size: 1.3rem; }
}
.mobile-nav-links { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.mobile-nav-links a {
  display: flex; align-items: center; min-height: 44px;
  font-family: var(--font-disp); font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600; letter-spacing: -.01em; color: var(--text);
  transition: color .25s;
}
.mobile-nav-links a:hover, .mobile-nav-links a:focus-visible, .mobile-nav-links a.active { color: var(--accent); }
#nav { z-index: calc(var(--z-nav) + 1); }

/* ── Tipografía / utilidades ── */
body .tag {
  display: inline-block; font-family: var(--font-body); font-size: .8125rem; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--accent);
  border: 0; background: none; padding: 0; border-radius: 0; margin-bottom: 14px;
}
.sec-title {
  font-family: var(--font-disp);
  font-size: clamp(1.9rem, 1rem + 2.8vw, 3.1rem);
  font-weight: 600; line-height: 1.06; letter-spacing: -.015em;
}
.ac { color: var(--accent); font-style: italic; font-weight: 560; }
h1 em, h2 em, h3 em, .sec-title em { font-style: italic; font-weight: 560; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: .95rem; line-height: 1;
  padding: 15px 28px; border-radius: var(--pill); border: 1.5px solid transparent; cursor: pointer;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .25s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .btn-fill:hover, .btn-ghost:hover, .btn-accent-ghost:hover { transform: translateY(-1px); } }
.btn:active { transform: scale(.98); }
.btn-fill { background: var(--accent); color: var(--accent-ink); }
.btn-fill:hover { background: var(--accent-h); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent-ghost { background: transparent; color: var(--accent); border-color: var(--accent-line); }
.btn-accent-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.magnetic { display: inline-block; transition: transform .2s var(--ease); }
/* Flecha final de enlaces y botones: avanza un poco al pasar el mouse o al enfocar con teclado */
.arrow { display: inline-block; transition: transform .25s var(--ease); }
a:focus-visible > .arrow, button:focus-visible > .arrow { transform: translateX(3px); }
@media (hover: hover) { a:hover > .arrow, button:hover > .arrow { transform: translateX(3px); } }

/* ── Aparición al hacer scroll ── */
/* Oculto solo si corrió el script del <head>: sin JS el contenido se ve */
.reveal { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(12px); }
.reveal.visible { opacity: 1; transform: none; }

/* ── Pie de página genérico ── */
footer { border-top: 0; padding: 48px 0 32px; font-size: .9rem; background: var(--bg); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
/* Pie único de las interiores: logo, frase de marca, enlaces y datos de contacto */
.foot-in { display: grid; gap: 14px; justify-items: start; }
.foot-in .foot-logo { display: block; padding: 0; margin: 0; line-height: 0; }
.foot-in .foot-logo img { display: block; width: min(300px, 100%); height: auto; }
.foot-tag { margin: 4px 0 0; font: 600 1.25rem/1.25 var(--font-disp); letter-spacing: -.01em; color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 6px; }
.foot-links a { color: var(--text-2); font-weight: 600; font-size: .92rem; padding-block: 8px; }
.foot-links a:hover { color: var(--accent); }
.foot-copy { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.7; }
.foot-copy a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding-block: 7px; margin-block: -7px; }
.foot-copy a:hover { color: var(--accent); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); }
.footer-right { display: flex; flex-wrap: wrap; gap: 8px 20px; min-width: 0; }
.footer-left { min-width: 0; }
/* Texto del pie legible (antes usaba --muted2, ~1,6:1 de contraste) */
footer .footer-left, footer .footer-right a { color: var(--muted); }
footer .footer-right a:hover { color: var(--accent); }
main:focus { outline: none; }
.footer-right a { color: var(--muted); transition: color .2s; }
/* Área táctil de al menos 32 px sin mover el diseño: el relleno se compensa con margen negativo */
.footer-right a, .footer-left a, .site-footer a, .page-footer a, .crumbs a, .breadcrumb a { display: inline-block; padding-block: 7px; margin-block: -7px; }
.footer-right a:hover { color: var(--text); }

/* ── Formularios ── */
.field { margin-bottom: 18px; }
.field label {
  font: 600 .8125rem var(--font-body); color: var(--text-2);
  display: block; margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: 14px;
  padding: 13px 16px; color: var(--text);
  font-family: var(--font-body); font-size: .9rem;
  outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.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 d='M1 1l5 5 5-5' stroke='%234B587A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px; cursor: pointer;
}
.field select option { background: var(--surface); color: var(--text); }

/* ── Tarjetas ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color .25s, transform .3s var(--ease), background .25s;
}
.card:hover { border-color: var(--accent-line); background: var(--surface2); }
@media (hover: hover) and (pointer: fine) { .card:hover { transform: translateY(-3px); } }
.card-icon { font-size: 1.5rem; margin-bottom: 14px; display: block; }
.card h3 { font-family: var(--font-disp); font-size: 1.15rem; font-weight: 600; margin-bottom: 10px; }
.card p { font-size: .875rem; color: var(--muted); line-height: 1.65; }

/* ── Acordeón ── */
.accordion { margin-top: 32px; }
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-btn {
  width: 100%; background: none; border: none;
  padding: 18px 0; text-align: left;
  font-family: var(--font-disp); font-size: 1rem;
  font-weight: 600; color: var(--text); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: color .2s;
}
.accordion-btn:hover { color: var(--accent); }
.accordion-btn .icon { font-size: 1.2rem; color: var(--accent); transition: transform .3s var(--ease); }
.accordion-btn.open .icon { transform: rotate(45deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height .28s var(--ease); }
.accordion-body p { padding: 0 0 18px; font-size: .9rem; color: var(--muted); line-height: 1.7; }

/* ── Interruptor (precios) ── */
.toggle-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 24px 0; }
.toggle-row span { font-size: .88rem; color: var(--muted); }
.toggle-row span.active-label { color: var(--text); font-weight: 600; }
.toggle-switch {
  position: relative; width: 48px; height: 26px;
  background: var(--border); border-radius: 99px;
  cursor: pointer; transition: background .3s;
}
.toggle-switch.active { background: var(--accent); }
.toggle-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  transition: transform .3s var(--ease);
}
.toggle-switch.active::after { transform: translateX(22px); }
.saving-badge {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 12px; border-radius: var(--pill); border: 1px solid var(--accent-line);
}

/* ── Móvil: tacto y áreas seguras ── */
@media (max-width: 1024px) {
  * { -webkit-tap-highlight-color: transparent; }
  a, button, [role="button"], label { touch-action: manipulation; }
  #nav { padding-top: max(14px, env(safe-area-inset-top)); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  #nav.glass { padding-top: max(10px, env(safe-area-inset-top)); }
  footer { padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 24px)) !important; }
}
@media (max-width: 640px) { footer { padding-bottom: max(88px, calc(env(safe-area-inset-bottom) + 88px)) !important; } } /* el flotante no tapa los enlaces */
@media (max-width: 768px) {
  #nav { padding: max(12px, env(safe-area-inset-top)) 0 12px; }
  #nav.glass { background: rgba(246,238,220,.94); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  /* Logo proporcional al ancho: logo + carrito + hamburguesa caben desde 320 px */
  .nav-logo-img { height: clamp(24px, calc(7.62vw - 2px), 30px); max-width: 240px; }
  .nav-logo { margin-right: auto; }
  #nav .nav-inner { gap: 12px; }
  .nav-actions .magnetic { display: none; }
  section { padding: 60px 0; }
}

@keyframes menuCTAIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* Enlaces: entran en cascada con un barrido hacia arriba; al cerrar se apagan rápido mientras el círculo se cierra */
#mobile-overlay .mobile-nav-links a {
  opacity: 0; translate: 0 .6em; clip-path: inset(0 0 100% 0);
  transition: opacity .18s, translate .18s, clip-path .18s, color .25s;
}
#mobile-overlay.open .mobile-nav-links a {
  opacity: 1; translate: 0 0; clip-path: inset(-.2em -1em -.3em -1em);
  transition: opacity .3s var(--ease) var(--md), translate .4s var(--ease) var(--md), clip-path .4s var(--ease) var(--md), color .25s;
}
#mobile-overlay .mobile-nav-links a:nth-child(1) { --md: .06s; }
#mobile-overlay .mobile-nav-links a:nth-child(2) { --md: .10s; }
#mobile-overlay .mobile-nav-links a:nth-child(3) { --md: .14s; }
#mobile-overlay .mobile-nav-links a:nth-child(4) { --md: .18s; }
#mobile-overlay .mobile-nav-links a:nth-child(n+5) { --md: .22s; }
#mobile-overlay > .btn, #mobile-overlay > .magnetic { opacity: 0; transition: opacity .18s; }
#mobile-overlay.open > .btn, #mobile-overlay.open > .magnetic { animation: menuCTAIn .35s var(--ease) .24s both; }
.mobile-nav-links a:active { color: var(--accent) !important; }

/* ── Transición entre páginas: el menú y el botón de WhatsApp se quedan quietos; solo cambia el contenido ── */
@view-transition { navigation: auto; }
#nav { view-transition-name: site-nav; }
.wa-fab { view-transition-name: site-wa; }
::view-transition-old(root) { animation: vtOut .18s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .4s var(--ease) .12s both; }
::view-transition-group(site-nav), ::view-transition-group(site-wa) { animation-duration: .3s; animation-timing-function: var(--ease); }
/* Foto de un caso que viaja de la portada a su página (mismo view-transition-name en ambas) */
::view-transition-group(case-cornelius) { animation-duration: .45s; animation-timing-function: var(--ease); }
::view-transition-old(case-cornelius), ::view-transition-new(case-cornelius) { height: 100%; object-fit: cover; object-position: top; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }

/* ── Movimiento reducido ── */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  #mobile-overlay .mobile-nav-links a, #mobile-overlay > .btn, #mobile-overlay > .magnetic { opacity: 1; translate: none; clip-path: none; }
  #mobile-overlay { clip-path: none; }
  #mobile-overlay, #mobile-overlay *, #mobile-overlay::before, .hamburger span { transition-delay: 0s !important; }
}

/* ═══ Botón flotante de WhatsApp ═══ */
.wa-fab {
  position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: var(--z-chat, 850);
  display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--accent-line);
  font: 700 .88rem var(--font-body); box-shadow: 0 14px 32px -14px rgba(20,35,74,.45);
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease), opacity .25s;
}
.wa-fab.wa-fab--oculto { opacity: 0; pointer-events: none; transform: translateY(16px); }
.wa-fab svg { width: 22px; height: 22px; color: var(--accent); transition: color .25s; }
.wa-fab:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .wa-fab:hover { transform: translateY(-2px); } }
.wa-fab:hover svg { color: var(--accent-ink); }
.wa-fab:active { transform: scale(.97); }
.wa-fab--raised { bottom: 92px; right: 28px; }
/* Bajo 1560 px la píldora pisaría la columna derecha del contenido: queda solo el icono */
@media (max-width: 1559px) {
  .wa-fab span { display: none; }
  .wa-fab { width: 48px; padding: 0; justify-content: center; }
}
@media (max-width: 640px) {
  /* En móvil queda un solo botón flotante: la burbuja de Chapita, que deja elegir WhatsApp (ver #chat-elige). El WhatsApp flotante solo queda en las páginas sin chat (contrato, cotización, brief…) */
  .wa-fab--raised { right: 22px; bottom: max(20px, env(safe-area-inset-bottom)); }
  body.has-cookie-banner .wa-fab { bottom: 154px; } /* sobre el aviso de cookies, no escondido */
}
/* ═══ Banner de cookies ═══ */
/* Bajo el carrito y el pago (si no, tapa el botón de pagar a quien aún no responde) */
.cookie-banner {
  position: fixed; left: 16px; bottom: 16px; z-index: calc(var(--z-overlay) - 1); max-width: 660px;
  display: flex; align-items: center; gap: 18px; padding: 12px 12px 12px 18px; border-radius: var(--radius-lg);
  background: var(--surface2); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px -20px rgba(20,35,74,.4);
  font-size: .84rem; line-height: 1.45; color: var(--text-2);
}
.cookie-banner a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { padding: 10px 16px; font-size: .84rem; flex: 1; }
@media (max-width: 640px) {
  .cookie-banner { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-width: none; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; font-size: .8rem; line-height: 1.4; }
  .cookie-actions .btn { min-height: 44px; padding: 10px 14px; }
}

/* Iconos SVG en línea (reemplazan a los emojis) */
.ico { width: 1.05em; height: 1.05em; vertical-align: -.16em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ═══ Chat con el asistente (lo pone main.js en todas las páginas) ═══ */
#chat-fab {
  position: fixed; right: max(28px, calc(env(safe-area-inset-right) + 16px)); bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px)); z-index: var(--z-chat, 850);
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 14px 32px -14px rgba(20,35,74,.45);
  transition: transform .3s var(--ease), box-shadow .3s, background .3s;
}
@media (hover: hover) and (pointer: fine) { #chat-fab:hover { transform: scale(1.08); } }
#chat-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
#chat-fab[aria-expanded="true"] { background: var(--surface); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
#chat-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
/* Cerrado: el disco arcilla de Chapita con un aro claro, como en la maqueta; la X de cerrar conserva el botón de antes */
#chat-fab:not([aria-expanded="true"]) { padding: 0; background: var(--surface); box-shadow: 0 0 0 3px var(--surface), 0 14px 32px -14px rgba(20,35,74,.45); }
#chat-fab img { display: block; width: 100%; height: 100%; border-radius: 50%; }
#chat-panel {
  position: fixed; right: max(28px, calc(env(safe-area-inset-right) + 16px)); bottom: max(92px, calc(env(safe-area-inset-bottom) + 88px)); z-index: var(--z-chat, 850);
  width: 380px; height: min(560px, calc(100dvh - 120px)); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
  box-shadow: 0 24px 60px rgba(20,35,74,.3), 0 0 0 1px var(--border);
  transform: scale(.92) translateY(16px); transform-origin: bottom right; opacity: 0; visibility: hidden;
  transition: transform .35s var(--ease), opacity .3s, visibility 0s .35s;
}
#chat-panel.open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
#chat-panel iframe { width: 100%; height: 100%; border: none; display: block; }
#chat-panel iframe[hidden] { display: none; }
.chat-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 28px; background: var(--surface); }
.chat-fallback p { font-weight: 600; color: var(--text); }
.chat-fallback a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* Celular: una sola burbuja, la de Chapita. Al tocarla se elige entre Chapita y WhatsApp (#chat-elige; decisión del dueño, 13 nov 2026) */
#chat-elige {
  position: fixed; right: 16px; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 60px); z-index: var(--z-chat, 850);
  width: min(300px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: 0 24px 60px rgba(20,35,74,.3), 0 0 0 1px var(--border); transform-origin: bottom right; animation: eligeIn .28s var(--ease) both;
}
#chat-elige[hidden] { display: none; }
#chat-elige p { margin: 0 4px 2px; font-weight: 700; color: var(--text); }
#chat-elige button, #chat-elige a {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 12px; border-radius: var(--radius);
  border: 1.5px solid rgba(20,35,74,.35); background: var(--surface); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
#chat-elige button:active, #chat-elige a:active { background: var(--surface2); }
#chat-elige button:focus-visible, #chat-elige a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#chat-elige b { display: block; font-weight: 700; }
#chat-elige small { display: block; margin-top: 2px; font-size: .875rem; color: var(--text-2); }
#chat-velo { position: fixed; inset: 0; z-index: calc(var(--z-chat, 850) - 1); background: rgba(20,35,74,.22); cursor: pointer; }
#chat-velo[hidden] { display: none; }
#chat-elige img { flex: none; width: 36px; height: 36px; border-radius: 50%; }
#chat-elige svg { flex: none; width: 28px; height: 28px; margin: 0 4px; color: var(--accent); }
@keyframes eligeIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { #chat-elige { animation: none; } }
@media (max-width: 640px) {
  #chat-fab { right: 22px; bottom: max(20px, env(safe-area-inset-bottom)); width: 48px; height: 48px; }
  #chat-panel { left: 12px; right: 12px; width: auto; bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px)); height: min(72vh, calc(100dvh - 100px)); border-radius: var(--radius); }
  body:has(#chat-fab) .wa-fab { display: none; }
  /* espera mientras se ve el hero, como hacía WhatsApp; nunca se esconde abierta (es la X de cerrar) */
  #chat-fab { transition: transform .3s var(--ease), opacity .25s, box-shadow .3s, background .3s, bottom .3s var(--ease); }
  #chat-fab.fab--oculto:not([aria-expanded="true"]) { opacity: 0; pointer-events: none; transform: translateY(16px); }
  body.has-cookie-banner #chat-fab { bottom: 154px; } /* sobre el aviso de cookies, no escondida */
  body.has-cookie-banner #chat-elige { bottom: 214px; }
  body.has-cookie-banner #chat-panel { bottom: 214px; height: min(72vh, calc(100dvh - 300px)); } /* que la X no tape el botón de enviar */
  /* con el chat abierto, el aviso de cookies se aparta (sigue pendiente y vuelve al cerrar) y el chat recupera su alto */
  body.has-cookie-banner.chat-open .cookie-banner { display: none; }
  body.has-cookie-banner.chat-open #chat-fab { bottom: max(20px, env(safe-area-inset-bottom)); }
  body.has-cookie-banner.chat-open #chat-panel { bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px)); height: min(72vh, calc(100dvh - 100px)); }
}

/* El botón de WhatsApp se oculta mientras el chat está abierto */
body.chat-open .wa-fab { display: none; }

/* Impresión: fuera lo que es de la pantalla */
@media print { .cookie-banner, .wa-fab, #chat-fab, #chat-panel, #nav, #mobile-overlay, #progress, footer:has(.foot-in) { display: none !important; } }

/* El botón del menú se esconde mientras el mismo llamado está a la vista en la portada (regla del dueño, 8 nov) */
.nav-cta { transition: opacity .2s var(--ease, ease), visibility .2s; }
.nav-cta.nav-cta--oculto { opacity: 0; visibility: hidden; pointer-events: none; }
