/* ═══════════════════════════════════════════════════════════════════
   AnonimoDsn — Sistema de diseño compartido (v2)
   Tokens · Base · Navegación · Botones · Componentes · Movimiento
   Un solo acento (verde), un solo gris cálido, líneas finas en vez de cajas.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Cuatro tiradores de esquina del marco de selección */
  --sel-handles: linear-gradient(var(--bg), var(--bg)) 1px 1px / 6px 6px no-repeat, linear-gradient(var(--bg), var(--bg)) calc(100% - 1px) 1px / 6px 6px no-repeat, linear-gradient(var(--bg), var(--bg)) 1px calc(100% - 1px) / 6px 6px no-repeat, linear-gradient(var(--bg), var(--bg)) calc(100% - 1px) calc(100% - 1px) / 6px 6px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 0 / 8px 8px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 0 / 8px 8px no-repeat, linear-gradient(var(--accent), var(--accent)) 0 100% / 8px 8px no-repeat, linear-gradient(var(--accent), var(--accent)) 100% 100% / 8px 8px no-repeat;
  /* Superficies: una sola familia de grises cálidos */
  --bg: #141210;
  --bg-2: #181614;
  --surface: #1c1917;
  --surface2: #232019;
  --border: #2d2822;
  --line: rgba(240,234,224,.09);
  --line-strong: rgba(240,234,224,.17);
  /* Texto */
  --text: #f1ebe0;
  --text-2: #cbc2b1;
  --muted: #9a9080;
  --muted2: #3a3228;
  /* Acento único */
  --accent: #5db894;
  --accent-h: #74c9a9;
  --accent-ink: #0e1a14;
  --accent-soft: rgba(93,184,148,.10);
  --accent-line: rgba(93,184,148,.34);
  /* Tipografía */
  --font-disp: 'Syne', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  /* Forma y movimiento */
  --ease: cubic-bezier(.16,1,.3,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  /* Escala de capas */
  --z-nav: 900;
  --z-overlay: 1000;
  --z-modal: 1100;
  --z-toast: 1200;
  --z-progress: 1300;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); 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; }
p, li { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
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); }
: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: 0%; background: var(--accent);
  transition: width .1s linear;
}

/* La barra sigue el scroll desde el CSS donde se puede (sin JS y sin recalcular el ancho) */
@supports (animation-timeline: scroll()) {
  /* !important: 20 páginas aún fijan style.width por su cuenta */
  #progress { width: 100% !important; transform: scaleX(0); transform-origin: 0 50%; transition: none; 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 transparent;
  transition: background .35s, border-color .35s, padding .35s var(--ease);
}
#nav.glass {
  background: rgba(20,18,16,.78);
  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: 8px; border: 1px solid var(--border); background: none; color: var(--muted); 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: 44px; 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 .35s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::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: 600; font-size: .84rem; padding: 9px 16px; border-radius: 8px;
  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); box-shadow: 0 8px 22px -8px rgba(93,184,148,.6); }
.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: .82rem; font-weight: 500; 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 { padding: 9px 16px; font-size: .84rem; }
@media (min-width: 769px) { #nav .nav-logo-img { height: 36px; } } /* 44px no cabía: el menú se salía entre 1241 y 1320px */
/* 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: 8px;
}
/* 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 .45s cubic-bezier(.3,.6,.3,1) .05s, visibility 0s .5s;
}
#mobile-overlay.open { visibility: visible; clip-path: circle(142vmax at calc(100% - 46px) 36px); transition: clip-path .7s cubic-bezier(.7,0,.3,1), 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 {
  font-family: var(--font-disp); font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 700; letter-spacing: -.02em; 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: 700; line-height: 1.08; letter-spacing: -.028em;
}
.ac { color: var(--accent); font-style: normal; }
h1 em, h2 em, h3 em, .sec-title em { font-style: normal; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem; line-height: 1;
  padding: 14px 24px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .25s var(--ease);
}
.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); transform: translateY(-1px); box-shadow: 0 12px 28px -12px rgba(93,184,148,.7); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.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); transform: translateY(-1px); }
.magnetic { display: inline-block; transition: transform .2s 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 ── */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

/* ── Pie de página genérico ── */
footer { border-top: 1px solid var(--line); padding: 24px 0; }
.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(--bg);
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 12px 14px; 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='%239a9080' 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); transform: translateY(-3px); background: var(--surface2); }
.card-icon { font-size: 1.5rem; margin-bottom: 14px; display: block; }
.card h3 { font-family: var(--font-disp); font-size: 1.05rem; font-weight: 700; 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: 700; 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 .35s 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 10px; border-radius: 4px; 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: 768px) {
  #nav { padding: max(12px, env(safe-area-inset-top)) 0 12px; }
  #nav.glass { background: rgba(20,18,16,.9); 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(20px, calc(12.6vw - 21px), 36px); max-width: 284px; }
  .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 .4s var(--ease) var(--md), translate .6s var(--ease) var(--md), clip-path .6s var(--ease) var(--md), color .25s;
}
#mobile-overlay .mobile-nav-links a:nth-child(1) { --md: .18s; }
#mobile-overlay .mobile-nav-links a:nth-child(2) { --md: .24s; }
#mobile-overlay .mobile-nav-links a:nth-child(3) { --md: .30s; }
#mobile-overlay .mobile-nav-links a:nth-child(4) { --md: .36s; }
#mobile-overlay .mobile-nav-links a:nth-child(n+5) { --md: .42s; }
#mobile-overlay > .btn, #mobile-overlay > .magnetic { opacity: 0; transition: opacity .18s; }
#mobile-overlay.open > .btn, #mobile-overlay.open > .magnetic { animation: menuCTAIn .5s var(--ease) .5s 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 ease-in 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); }
@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; }
  .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(--surface2); color: var(--text); border: 1px solid var(--accent-line);
  font: 600 .85rem var(--font-body); box-shadow: 0 14px 32px -14px rgba(0,0,0,.8);
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease);
}
.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); 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: WhatsApp (el chat se oculta más abajo) */
  .wa-fab--raised { right: 22px; bottom: max(20px, env(safe-area-inset-bottom)); }
  body.has-cookie-banner .wa-fab { display: none; }
}
/* ═══ 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(0,0,0,.85);
  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 4px 20px rgba(93,184,148,.35);
  transition: transform .3s var(--ease), box-shadow .3s, background .3s;
}
#chat-fab:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(93,184,148,.5); }
#chat-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
#chat-fab[aria-expanded="true"] { background: var(--surface2); 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; }
#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(0,0,0,.6), 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; }
@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); }
  #chat-fab { display: none; }
}

/* El botón de WhatsApp se oculta mientras el chat está abierto */
body.chat-open .wa-fab { display: none; }

/* ═══ Regla de sección: el tirador del lienzo recorre el borde superior al entrar en pantalla ═══
   Decorativo: sin soporte o con movimiento reducido no aparece. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    /* Secciones: un tirador recorre la regla superior de cada sección mientras entra en pantalla */
    .hp-sec, .pg-sec { container-type: inline-size; view-timeline-name: --sh; }
    .hp-sec::before, .hp-sec::after, .pg-sec::before, .pg-sec::after {
      content: ""; position: absolute; left: 0; pointer-events: none;
      animation-timing-function: linear; animation-fill-mode: both;
      animation-timeline: --sh; animation-range: entry 8% entry 70%;
    }
    .hp-sec::after, .pg-sec::after { right: 0; top: -1px; height: 1px; background: var(--accent-line); transform-origin: 0 50%; animation-name: shRule; }
    .hp-sec::before, .pg-sec::before { top: -4px; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--accent); z-index: 1; animation-name: shHandle; }
  }
}
@keyframes shRule { from { transform: scaleX(0); } }
@keyframes shHandle { 0% { opacity: 0; } 10%, 88% { opacity: 1; } 100% { opacity: 0; translate: calc(100cqw - 7px) 0; } }

/* Impresión: fuera lo que es de la pantalla */
@media print { .cookie-banner, .wa-fab, #chat-fab, #chat-panel, #nav, #mobile-overlay, #progress { display: none !important; } }
