/* mipiscinaclara.com · base.css
   Estilo de la calculadora de pH v5 (16/10/2026) para TODA la web: cabecera de página turquesa oscuro
   con ola, Inter alojada en /assets/fonts/ y un único color de acción (--action) para todo lo que se pulsa. */

/* ===== FUENTE: Inter (SIL OFL, ver assets/fonts/OFL.txt), solo latín: cubre el español ===== */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }

/* ===== TOKENS ===== */
:root {
  /* Paleta de agua PiscinaClara */
  --ink: #0d2b3a; --body: #24414f; --muted: #4f6b78;
  --canvas: #ffffff; --page: #f6fbfc; --water: #e8f5f8; --water-2: #d9eff4;
  --hairline: rgba(13, 43, 58, .10); --field: #c3d9e0;
  --brand-drop: #19c3c9;                    /* turquesa de la marca: logotipo */
  --hero: #08697a; --on-hero: #ffffff; --on-hero-soft: #e3f6f8;   /* cabecera de página: blanco 6,3:1, migas 5,7:1 */
  /* Un único color de acción: todo lo que se pulsa */
  --action: #0a6f8f; --action-hover: #085a75; --on-action: #ffffff;
  /* Colores de estado (información, no acciones) */
  --ok: #127a52; --ok-soft: #e4f4ec; --off: #a85400; --bad: #b42318; --bad-soft: #fdeceb; --warn-soft: #fff4de;
  --ph-red: #e5484d; --ph-orange: #f2994a; --ph-yellow: #f2c94c; --ph-green: #3dbb7d;
  /* Espaciado (DESIGN.md) */
  --s-xxs: 4px; --s-xs: 8px; --s-sm: 12px; --s-md: 17px; --s-lg: 24px; --s-xl: 32px; --s-xxl: 48px; --s-section: 80px;
  /* Radios (DESIGN.md) */
  --r-sm: 8px; --r-md: 11px; --r-lg: 18px; --r-pill: 9999px;
  --header-h: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s-md)); scroll-padding-bottom: 96px; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "ss03";
       font-size: 17px; line-height: 1.44; color: var(--body); background: var(--page); }
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
a, button, input, select, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: var(--action); }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }
.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; }
.skip { position: absolute; left: var(--s-md); top: -100px; z-index: 50; background: var(--action); color: var(--on-action); padding: var(--s-sm) var(--s-md); border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip:focus { top: var(--s-sm); color: var(--on-action); }

/* ===== CABECERA ===== */
.site { background: var(--canvas); border-bottom: 1px solid var(--hairline); position: sticky; top: 0; z-index: 10; }
.site-in { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--s-xs); min-height: 44px; text-decoration: none; color: var(--ink); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand b { color: var(--brand-drop); font-weight: 700; }
.logo { width: 26px; height: 26px; color: var(--brand-drop); }
/* Menú: en línea desde 760 px; en móvil, botón "Menú" que despliega la lista */
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s-xxs); }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 var(--s-sm);
         text-decoration: none; color: var(--body); font-size: 15px; border-radius: var(--r-pill); white-space: nowrap; }
.nav a:hover { color: var(--action); background: var(--water); }
.nav a[aria-current="page"], .nav a.is-section { color: var(--action); font-weight: 600; background: var(--water); }
.menu-btn { display: none; align-items: center; gap: var(--s-xs); min-height: 44px; padding: 0 var(--s-md); border: 1px solid var(--field); border-radius: var(--r-pill);
            background: var(--canvas); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.menu-btn:hover { border-color: var(--action); color: var(--action); }
.menu-btn svg { width: 18px; height: 18px; }
@media (max-width: 759px) {
  .js .menu-btn { display: inline-flex; }
  .js .nav ul { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column; gap: 0;
                background: var(--canvas); border-bottom: 1px solid var(--hairline); padding: var(--s-xs) max(16px, env(safe-area-inset-left)) var(--s-md); }
  .js .nav.open ul { display: flex; }
  .js .nav a { justify-content: flex-start; width: 100%; min-height: 48px; font-size: 17px; border-radius: var(--r-md); padding: 0 var(--s-md); }
  .nav ul { flex-wrap: wrap; }
}

/* ===== CABECERA DE PÁGINA: turquesa oscuro plano + ola (sin degradados) ===== */
.hero { position: relative; background: var(--hero); color: var(--on-hero); padding: var(--s-lg) 0 calc(var(--s-xl) + 36px); }
.crumb { margin: 0 0 var(--s-xs); font-size: 14px; color: var(--on-hero-soft); }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; }
.crumb li + li::before { content: "›"; margin: 0 var(--s-xs); }
.crumb a { color: var(--on-hero-soft); text-underline-offset: 3px; }
.crumb a:hover { color: var(--on-hero); }
.hero :focus-visible { outline-color: var(--on-hero); }
.hero h1 { color: var(--on-hero); font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: var(--s-sm); }
.lead { margin: 0; color: var(--on-hero); max-width: 560px; }
/* La ola es una máscara SVG: no hace falta repetir el SVG en cada página */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 36px; background: var(--page);
               -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30c120 20 240 20 360 0s240-20 360 0 240 20 360 0 240-20 360 0v30H0z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
                       mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30c120 20 240 20 360 0s240-20 360 0 240 20 360 0 240-20 360 0v30H0z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

main { padding: var(--s-lg) 0 var(--s-xxl); }

/* ===== TARJETAS ===== */
.card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s-md); margin-bottom: var(--s-md); }
.card-h { display: flex; align-items: center; gap: var(--s-sm); margin-bottom: var(--s-md); }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--water); color: var(--ink); font-size: 14px; font-weight: 600; }
.card-h h2 { font-size: 21px; line-height: 1.19; }
label { display: block; font-weight: 600; font-size: 15px; color: var(--ink); margin: var(--s-sm) 0 var(--s-xs); }
.hint { color: var(--muted); font-size: 14px; line-height: 1.43; margin: var(--s-xs) 0 0; }
input, select { width: 100%; min-height: 48px; padding: var(--s-sm) var(--s-md); font: inherit; font-size: 17px; color: var(--ink);
                background: var(--canvas); border: 1px solid var(--field); border-radius: var(--r-md); }
input::placeholder { color: #7b929c; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px rgba(10, 111, 143, .25); }
input[aria-invalid="true"] { border-color: var(--bad); }
.err { color: var(--bad); font-size: 14px; line-height: 1.43; margin: var(--s-xxs) 0 0; }
.err:empty { display: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-sm); }
.row > div { min-width: 0; }
.dose-row { display: flex; align-items: center; gap: var(--s-sm); }
.dose-row input { width: 112px; flex: none; }
.unit { color: var(--muted); font-size: 15px; line-height: 1.3; }

/* Selector de forma: un grupo de botones */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-xxs); background: var(--water); padding: var(--s-xxs); border-radius: var(--r-md); }
.tabs button { min-height: 44px; padding: var(--s-xs) var(--s-xxs); border: 0; background: transparent; border-radius: var(--r-sm);
               font: inherit; font-size: 15px; color: var(--body); cursor: pointer; }
.tabs button:hover { background: var(--water-2); color: var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--action); color: var(--on-action); font-weight: 600; }
.hidden, [hidden] { display: none !important; }
.vol { margin-top: var(--s-md); padding: var(--s-sm) var(--s-md); background: var(--water); border-radius: var(--r-md); color: var(--ink); font-size: 15px; }
.vol b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===== RESULTADO ===== */
.res-wrap { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s-md); margin-bottom: var(--s-md); }
.phbar { position: relative; padding-top: 34px; margin: 0 var(--s-xxs) var(--s-md); }
/* Escala de 6,6 a 8,4: rojo <6,8 | naranja 6,8–7,0 | amarillo 7,0–7,2 | verde 7,2–7,6 | amarillo 7,6–7,8 | naranja 7,8–8,2 | rojo >8,2 */
.phbar-track { height: 12px; border-radius: var(--r-pill); background: linear-gradient(90deg,
    var(--ph-red) 0 10.6%, var(--ph-orange) 11.6% 21.7%, var(--ph-yellow) 22.7% 32.8%,
    var(--ph-green) 33.8% 55.1%, var(--ph-yellow) 56.1% 66.2%, var(--ph-orange) 67.2% 88.4%, var(--ph-red) 89.4% 100%); }
.phbar-scale { position: relative; height: 18px; margin-top: var(--s-xs); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phbar-scale span { position: absolute; transform: translateX(-50%); }
.phbar-scale span:nth-child(1) { left: 11.11%; } .phbar-scale span:nth-child(2) { left: 33.33%; }
.phbar-scale span:nth-child(3) { left: 55.56%; } .phbar-scale span:nth-child(4) { left: 88.89%; }
.mk { position: absolute; transform: translateX(-50%); transition: left .3s ease; }
.mk-now { top: 0; z-index: 2; }
.mk-now b { display: block; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 2px var(--s-xs); border-radius: var(--r-pill); position: relative; font-variant-numeric: tabular-nums; }
.mk-now b::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.mk-now.ok b { background: var(--ok); } .mk-now.ok b::after { border-top-color: var(--ok); }
.mk-now.off b { background: var(--off); } .mk-now.off b::after { border-top-color: var(--off); }
.mk-now.bad b { background: var(--bad); } .mk-now.bad b::after { border-top-color: var(--bad); }
.phbar.empty .mk-now { opacity: .35; }
.mk-target { top: 30px; width: 3px; height: 20px; background: var(--ink); border-radius: 2px; }
.phleg { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-xxs) var(--s-md); margin: var(--s-xs) 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.phleg li { display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; flex: none; }
.sw-ideal { width: 18px; height: 8px; border-radius: 4px; background: var(--ph-green); }
.sw-target { width: 3px; height: 12px; border-radius: 2px; background: var(--ink); }
.sw-now { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

.result { border-radius: var(--r-md); padding: var(--s-md); background: var(--water); }
.result p { margin: 0 0 var(--s-xs); }
.result.ok { background: var(--ok-soft); } .result.bad { background: var(--bad-soft); }
.res-k { color: var(--muted); font-size: 15px; }
.big { font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); margin: var(--s-xxs) 0 !important; font-variant-numeric: tabular-nums; }
.result.ok .big { color: var(--ok); } .result.bad .big { color: var(--bad); }
.result.ok .big, .result.bad .big { font-size: 21px; line-height: 1.19; letter-spacing: -0.01em; }
.res-p { font-weight: 600; color: var(--ink); }
.steps { margin: var(--s-sm) 0 0; padding-left: 20px; font-size: 15px; }
.steps li { margin-bottom: var(--s-xs); }
.warn { background: var(--warn-soft); color: #5c3400; border-radius: var(--r-sm); padding: var(--s-sm); margin-top: var(--s-sm); font-size: 14px; line-height: 1.43; }

/* ===== AFILIADOS ===== */
.aff { margin-bottom: var(--s-md); }
.aff-title { font-weight: 600; color: var(--ink); margin: var(--s-lg) 0 var(--s-sm); font-size: 17px; }
.aff-note { display: none; font-weight: 400; font-size: 14px; color: var(--muted); }
.aff-grid { display: grid; gap: var(--s-sm); }
.prod { display: grid; grid-template-columns: 88px 1fr; grid-template-areas: "img txt" "img btn"; column-gap: var(--s-md); row-gap: var(--s-sm);
        background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s-md); }
.prod-img { grid-area: img; width: 88px; height: 88px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--water); overflow: hidden; }
.prod-img svg, .prod-img img { width: 100%; height: 100%; object-fit: contain; }
.prod-txt { grid-area: txt; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.43; color: var(--muted); min-width: 0; }
.prod-txt strong { color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.24; }
.prod-tag { font-size: 12px; color: var(--muted); }
.prod .btn { grid-area: btn; }
/* Botón de acción: el único color de acción, en píldora */
.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; justify-self: start; align-self: end; min-height: 44px; padding: 0 22px;
       background: var(--action); color: var(--on-action); font-size: 15px; font-weight: 600; border-radius: var(--r-pill); text-decoration: none; transition: transform .1s ease, background-color .15s ease; }
.btn:hover { background: var(--action-hover); color: var(--on-action); }
.btn:active { transform: scale(.97); }

/* ===== GUÍA ===== */
.guide { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s-lg) var(--s-md); margin: var(--s-xl) 0 var(--s-md); }
.guide h2 { font-size: 28px; line-height: 1.14; letter-spacing: -0.02em; margin-bottom: var(--s-sm); }
.guide h3 { font-size: 21px; line-height: 1.19; margin: var(--s-lg) 0 var(--s-xs); }
.guide p { margin: 0 0 var(--s-sm); }
.aff-guide { margin-bottom: var(--s-xl); }
.aff-guide { margin-top: var(--s-lg); border-radius: var(--r-lg); padding: var(--s-md); background: var(--water); display: flex; flex-direction: column; gap: var(--s-md); }
.aff-guide-img { flex: none; width: 140px; height: 112px; border-radius: var(--r-md); background: var(--canvas); display: grid; place-items: center; overflow: hidden; }
.aff-guide-img svg, .aff-guide-img img { width: 100%; height: 100%; object-fit: contain; }
.aff-guide strong { display: block; color: var(--ink); font-size: 21px; font-weight: 600; line-height: 1.19; margin: var(--s-xxs) 0 var(--s-xs); }
.aff-guide p { margin: 0 0 var(--s-md); }


/* ===== GUÍA AMPLIADA: listas, tablas, preguntas y fecha ===== */
.guide h2 + p, .guide h2 + .tbl-wrap { margin-top: 0; }
.guide .guide-txt h2:not(:first-child) { margin-top: var(--s-xl); }
.guide ul, .guide ol { margin: 0 0 var(--s-sm); padding-left: 22px; }
.guide li { margin-bottom: var(--s-xs); }
.guide .steps { font-size: 17px; margin: 0 0 var(--s-sm); }
.guide .steps li { margin-bottom: var(--s-xs); }
.tbl-wrap { overflow-x: auto; margin: var(--s-sm) 0 var(--s-xs); border: 1px solid var(--hairline); border-radius: var(--r-md); -webkit-overflow-scrolling: touch; }
.tbl-wrap:focus-visible { outline-offset: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.tbl th, .tbl td { padding: var(--s-sm); text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl thead th { background: var(--water); color: var(--ink); font-weight: 600; vertical-align: bottom; }
.tbl tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.tbl td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-sub { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 479px) { .tbl { font-size: 14px; } .tbl th, .tbl td { padding: var(--s-xs) var(--s-xs); } .tbl tbody th { white-space: normal; } }
.tbl thead th { hyphens: auto; -webkit-hyphens: auto; }
.tbl-note { font-size: 14px; line-height: 1.43; color: var(--muted); }
.faq { border-top: 1px solid var(--hairline); margin-top: var(--s-sm); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm); min-height: 48px; padding: var(--s-sm) 0;
               cursor: pointer; list-style: none; color: var(--ink); font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--water); color: var(--action); font-size: 19px; font-weight: 600; }
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--action); }
.faq details p { margin: 0 0 var(--s-md); }
.updated { margin-top: var(--s-lg) !important; font-size: 14px; color: var(--muted); }

/* ===== HUECOS DE ANUNCIO (AdSense): tamaño reservado para que la página no salte ===== */
.ad { margin: var(--s-xl) auto; max-width: 728px; }
.ad-label { display: block; margin: 0 0 var(--s-xxs); font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; letter-spacing: .02em; }
.ad-box { min-height: 280px; display: grid; place-items: center; background: var(--water); border-radius: var(--r-md); overflow: hidden; color: var(--muted); font-size: 12px; }
.ad-box ins { display: block; width: 100%; }
.guide .ad { margin: var(--s-xl) auto; }
/* El primer hueco queda separado de los botones de afiliado (clics accidentales) */
.ad-after-aff { margin-top: var(--s-xxl); }

.safety, .legal { font-size: 14px; line-height: 1.43; color: var(--muted); margin: var(--s-sm) 0; }
.legal { border-top: 1px solid var(--hairline); padding-top: var(--s-sm); }
.page-meta { padding-bottom: var(--s-xl); }
.page-meta .updated { margin: 0 0 var(--s-sm) !important; }
.site-f { background: var(--canvas); border-top: 1px solid var(--hairline); color: var(--muted); font-size: 14px; padding: var(--s-lg) 0 calc(var(--s-lg) + env(safe-area-inset-bottom)); }
.site-f p { margin: 0 0 var(--s-sm); }
.site-f ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 var(--s-xxs); margin: 0 0 var(--s-sm) calc(-1 * var(--s-sm)); padding: 0; }
.site-f a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-sm); color: var(--body); text-decoration: none; border-radius: var(--r-pill); }
.site-f a:hover { color: var(--action); background: var(--water); }
.site-f small { font-size: 12px; }

/* ===== PÁGINAS DE TEXTO (legales, sobre nosotros) ===== */
.prose { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: var(--s-lg) var(--s-md); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 21px; line-height: 1.19; margin: var(--s-lg) 0 var(--s-xs); }
.prose p, .prose ul { margin: 0 0 var(--s-sm); }
.todo { background: var(--warn-soft); color: #5c3400; border-radius: var(--r-sm); padding: var(--s-sm); font-size: 14px; line-height: 1.43; }

/* ===== LISTADOS (portada y secciones) ===== */
.sec-h { font-size: 21px; line-height: 1.19; margin: 0 0 var(--s-sm); }
.items { list-style: none; margin: 0 0 var(--s-xl); padding: 0; display: grid; gap: var(--s-sm); }
.item a { display: flex; flex-direction: column; gap: var(--s-xxs); min-height: 44px; padding: var(--s-md); background: var(--canvas); border: 1px solid var(--hairline);
          border-radius: var(--r-lg); text-decoration: none; color: var(--muted); font-size: 15px; line-height: 1.4; }
.item a strong { color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.24; }
.item a .go { color: var(--action); font-weight: 600; font-size: 15px; margin-top: var(--s-xxs); }
.item a:hover { border-color: var(--action); }
.item a:hover strong { color: var(--action); }
.empty-note { background: var(--canvas); border: 1px dashed var(--field); border-radius: var(--r-lg); padding: var(--s-md); color: var(--muted); font-size: 15px; margin: 0 0 var(--s-xl); }
.intro { max-width: 640px; margin: 0 0 var(--s-xl); }
.intro p { margin: 0 0 var(--s-sm); }

/* ===== BARRA FIJA DEL RESULTADO ===== */
.sticky-res { position: fixed; z-index: 20; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
              bottom: calc(12px + env(safe-area-inset-bottom));
              display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm); min-height: 60px; padding: var(--s-xs) var(--s-xs) var(--s-xs) var(--s-md);
              border-radius: var(--r-lg); border: 1px solid var(--hairline); background: rgba(255, 255, 255, .88);
              -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
              color: var(--ink); text-decoration: none; transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .25s ease, visibility .25s; }
.sticky-res.on { transform: none; visibility: visible; }
.sticky-txt { font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; min-width: 0; }
.sticky-cta { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-md); border-radius: var(--r-pill); background: var(--action); color: var(--on-action); font-size: 15px; font-weight: 600; }
.sticky-res:hover .sticky-cta { background: var(--action-hover); }
body.has-sticky { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ===== RESPONSIVE ===== */
@media (max-width: 419px) {
  .tabs { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 420px) {
  .hero h1 { font-size: 34px; }
  .card, .res-wrap { padding: var(--s-lg); }
}
@media (min-width: 720px) {
  .items { grid-template-columns: 1fr 1fr; }
  .items-3 { grid-template-columns: repeat(3, 1fr); }
  .prose { padding: var(--s-xl); }
  .aff-grid { grid-template-columns: 1fr 1fr; }
  .prod { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "img" "txt" "btn"; }
  .aff-guide { flex-direction: row; align-items: center; padding: var(--s-lg); }
  .guide { padding: var(--s-xl); }
}
/* Escritorio: dos columnas; resultado fijo a la derecha con los afiliados debajo */
@media (min-width: 1024px) {
  .prose, .intro { max-width: 760px; }
  .wrap { max-width: 1120px; padding-left: var(--s-lg); padding-right: var(--s-lg); }
  .hero { padding: var(--s-xxl) 0 calc(var(--s-xxl) + 48px); }
  .hero::after { height: 48px; }
  .hero h1 { font-size: 40px; }
  main { padding-top: var(--s-xl); }
  .calc { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--s-lg); align-items: start; }
  .col-out { position: sticky; top: calc(var(--header-h) + var(--s-md)); }
  .res-wrap { padding: var(--s-md) var(--s-lg); margin-bottom: var(--s-sm); }
  .phbar { padding-top: 30px; margin-bottom: var(--s-sm); }
  .mk-target { top: 26px; }
  .result { padding: var(--s-sm) var(--s-md); }
  .steps { margin-top: var(--s-xs); font-size: 14px; }
  .steps li { margin-bottom: var(--s-xxs); }
  .warn { padding: var(--s-xs) var(--s-sm); margin-top: var(--s-xs); }
  .aff { margin-bottom: 0; }
  .aff-title { margin: 0 0 var(--s-xs); font-size: 15px; }
  .aff-note { display: inline; }
  .aff-grid { grid-template-columns: 1fr; gap: var(--s-xs); }
  .prod { grid-template-columns: 64px 1fr auto; grid-template-rows: auto; grid-template-areas: "img txt btn"; align-items: center; column-gap: var(--s-sm); padding: var(--s-sm); }
  .prod-img { width: 64px; height: 64px; }
  .prod-txt strong { font-size: 15px; }
  .prod .prod-tag { display: none; }
  .prod .btn { align-self: center; padding: 0 var(--s-md); font-size: 14px; }
  .guide { padding: var(--s-xxl); }
  .guide-txt { max-width: 760px; }
  .ad-box { min-height: 250px; }
  .ad-after-aff { margin-top: var(--s-xl); }
  /* En escritorio la barra resumen solo aparece si bajas hasta la guía */
  .sticky-res { left: auto; right: max(24px, calc((100vw - 1120px) / 2 + 24px)); width: 440px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:active { transform: none; }
}
