/* WEB.CSS (CSS-ARCH, Claude 1's ruling, 2026-10-20): the public site's own site-wide components, loaded right after base.css by
   layouts/v2 and layouts/v2-static, never by admin. What belongs here: public-only components that appear on every page (today
   the floating WhatsApp widget). Not here: page styles (their own sheet), copies of base.css patterns, any .ast-* rule (the
   system's classes live in base.css only). A pattern moves into base.css when a second consumer appears. Tokens only.

   WHATSAPP-WIDGET (components/whatsapp-contact, static/js/v2/whatsapp.js): a fixed button bottom-right (safe area) and its
   non-modal panel above it. Layer --ast-z-float (40): under the header (50, whose context holds the mini cart), the compare bar
   and dropdowns (60), modals (1040/1050), fancybox and the cookie banner (99999). Hidden while the cookie banner is up (the
   compare bar's rule). whatsapp.js lifts it above an expanded compare bar on phones (--v2-wa-lift, a transform: no layout
   shift) and steps it aside, like the compare bar, while a cart/checkout CTA is in the bottom band (.is-avoiding). The
   footer keeps room at its end so the button never covers its last row. WHATSAPP-MOBILE (David, 2026-10-26): at every width
   it also steps aside while a field or control is under it; hidden, it never takes a tap (pointer-events at once, not after
   the fade).
   The green (David, 2026-10-20: "El verde de WhatsApp queda para el icono/logo de marca"; Claude 1's amended rule): WhatsApp's
   brand green (WhatsApp brand resources, Meta Brand Resource Center) colours only the WhatsApp mark, and only on navy:
   #25D366 on --ast-navy 9.17:1, on --ast-navy-3 (hover/open) 6.68:1 (WCAG 1.4.11 ≥ 3:1). Never on white or the page
   background (1.98:1 / 1.82:1), never as a disc behind a white mark (1.98:1). The CTA stays .ast-btn--primary red; the footer
   and the contact cards stay monochrome. */
/* --ast-whatsapp lives on base.css's :root since DESIGN-AUDIT P2-1c (the design tokens in one place). */
/* FAB-IOS-LAG (David, 2026-11-14, iPhone Safari: «el botón "+" empieza a hacer cosas raras como si estuviese laggeado»; his shot
   shows a second «+» and a white box left over the text during a scroll): the fixed box is its own compositing layer
   (translate3d, will-change, no backface), so iOS moves it with the viewport instead of repainting it into the page's tiles. */
.v2-site .v2-wa{position:fixed;right:max(var(--ast-space-4),env(safe-area-inset-right));bottom:max(var(--ast-space-4),env(safe-area-inset-bottom));z-index:var(--ast-z-float);display:flex;flex-direction:column-reverse;align-items:flex-end;gap:var(--ast-space-3);transform:translate3d(0,calc(-1 * var(--v2-wa-lift, 0px)),0);will-change:transform;-webkit-backface-visibility:hidden;backface-visibility:hidden}
.v2-site:has(#cajacookies) .v2-wa{display:none}
.v2-site .v2-wa.is-avoiding .v2-wa__toggle{visibility:hidden;opacity:0;pointer-events:none}
.v2-site .v2-wa__toggle{display:grid;place-items:center;width:56px;height:56px;padding:0;border:0;border-radius:var(--ast-radius-pill);background:var(--ast-navy);color:var(--ast-whatsapp);box-shadow:0 0 0 2px var(--ast-white),var(--ast-shadow);cursor:pointer;text-decoration:none;touch-action:manipulation}
.v2-site .v2-wa__toggle:hover{background:var(--ast-navy-3);color:var(--ast-whatsapp)}
.v2-site .v2-wa__toggle:focus-visible{outline:3px solid var(--ast-focus);outline-offset:3px}
.v2-site .v2-wa__toggle[aria-expanded="true"]{background:var(--ast-navy-3)}
.v2-site .v2-wa__panel{width:min(22rem,calc(100vw - 2 * var(--ast-space-4)));max-height:calc(100dvh - 56px - 3 * var(--ast-space-4));overflow:auto;overscroll-behavior:contain;padding:var(--ast-space-5);border:1px solid var(--ast-border);border-radius:var(--ast-radius);background:var(--ast-surface);color:var(--ast-text);box-shadow:var(--ast-shadow)}
.v2-site .v2-wa__panel[hidden]{display:none}
.v2-site .v2-wa__head{display:flex;align-items:center;gap:var(--ast-space-3);margin-bottom:var(--ast-space-4)}
.v2-site .v2-wa__mark{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:var(--ast-radius-pill);background:var(--ast-navy);color:var(--ast-whatsapp)}
.v2-site .v2-wa__title{flex:1 1 auto;margin:0;font-size:var(--ast-text-base);font-weight:600;line-height:1.3}
.v2-site .v2-wa__close{display:grid;place-items:center;flex:none;width:44px;height:44px;margin:-10px -10px -10px 0;padding:0;border:0;border-radius:var(--ast-radius-pill);background:none;color:var(--ast-text-2);cursor:pointer;touch-action:manipulation}
.v2-site .v2-wa__close:hover{background:var(--ast-bg);color:var(--ast-text)}
.v2-site .v2-wa__close:focus-visible{outline:3px solid var(--ast-focus);outline-offset:-3px}
.v2-site .v2-wa__body{display:grid;gap:var(--ast-space-1);margin-bottom:var(--ast-space-5);font-size:var(--ast-text-sm)}
.v2-site .v2-wa__body p{margin:0}
.v2-site .v2-wa__hello{font-size:var(--ast-text-base);font-weight:600}
.v2-site .v2-wa__body .v2-wa__note{margin-top:var(--ast-space-2);color:var(--ast-muted)}
.v2-site:has(.v2-wa) .v2-footer{padding-bottom:calc(56px + 2 * var(--ast-space-4))}
/* W39-18 / WA-Q2 (WCAG 2.4.11 on layouts.v2-static, which has no scripts, so whatsapp.js can't scroll a focused control
   clear): the page's scroll container is html, so the browser's focus scroll keeps the link-only button's band free. The one
   rule not under .v2-site: the documented exception Claude 1 approved (REVIEW.md, "Claude 1, on W39-18"; WA-Q2). The tokens
   live on .v2-site (body), not on html, where var(--ast-space-4) would be undefined and drop the declaration; hence the
   literal 2rem (= 2 × --ast-space-4) plus the safe area the button's own bottom offset follows. */
html:has(> body.v2-site .v2-wa--link-only){scroll-padding-bottom:calc(56px + 2rem + env(safe-area-inset-bottom))}
/* DA-14 MOBILE-SPEED-DIAL (David, 2026-10-21): on phones (≤767px, the breakpoint where the topbar already hid «Mi cuenta»), once
   whatsapp.js runs (.is-dial-ready), the button's place is one navy «+» toggle (it turns 45° into «×» when open) and the stack
   rises above it in the same column: WhatsApp (this button, unchanged, its panel above it), «Mi cuenta», the language (DA-12's
   menus, opening to the left of their circle). Closed, the stack is invisible, unfocusable and lets taps through. The topbar
   hides while the dial is there. Everywhere else the new controls are display:none and the wrapper display:contents: the
   widget's boxes are what they were.
   MOBILE-POLISH-1 (David, 2026-11-13: «el top header… aparece en el móvil antes de aceptar las cookies y después desaparece»): it
   used to stay while the cookie banner (which hides the widget) was up; now it hides then too, as DA-14 asked («en movil yo
   quitaria la top bar»), and the language is in the header's menu instead (.v2-nav-language: on phones with the dial only). */
.v2-site .v2-dial__toggle,.v2-site .v2-dial__menu{display:none}
.v2-site .v2-dial__items{display:contents}
.v2-site .v2-nav-language{display:none}
/* PERF-MOBILE (FE-PM-2): the same from the first paint, before the widget at the end of the page is parsed (the topbar showed, then
   went: a 44px jump), on a page that has the «+» (v2.header: .v2-header--dial); .is-dial-off (the widget's line: whatsapp.js never
   ran) shows it again, as the :has rule below does. Without script the topbar stays. */
@media(max-width:767px) and (scripting:enabled){
  .v2-site .v2-header--dial:not(.is-dial-off) .v2-topbar{display:none}
  .v2-site .v2-header--dial:not(.is-dial-off) .v2-nav-language{display:block}
}
@media(max-width:767px){
  .v2-site:has(.v2-wa.is-dial-ready) .v2-topbar{display:none}
  .v2-site:has(.v2-wa.is-dial-ready) .v2-nav-language{display:block}
  .v2-site .v2-wa.is-dial-ready .v2-dial__toggle{display:grid;place-items:center;width:56px;height:56px;padding:0;border:0;border-radius:var(--ast-radius-pill);background:var(--ast-navy);color:var(--ast-white);box-shadow:0 0 0 2px var(--ast-white),var(--ast-shadow);cursor:pointer;touch-action:manipulation;pointer-events:auto}
  .v2-site .v2-wa.is-dial-ready .v2-dial__toggle:hover,.v2-site .v2-wa.is-dial-ready .v2-dial__toggle[aria-expanded="true"]{background:var(--ast-navy-3)}
  .v2-site .v2-dial__toggle:focus-visible{outline:3px solid var(--ast-focus);outline-offset:3px}
  .v2-site .v2-dial__toggle[aria-expanded="true"] svg{transform:rotate(45deg)}
  .v2-site .v2-wa.is-avoiding .v2-dial__toggle{visibility:hidden;opacity:0;pointer-events:none}
  .v2-site .v2-wa.is-dial-ready .v2-dial__items{display:flex;flex-direction:column-reverse;align-items:center;gap:var(--ast-space-3);width:56px}
  .v2-site .v2-wa.is-dial-ready .v2-dial__menu{display:block;position:relative}
  .v2-site .v2-wa.is-dial-ready:not(.is-dial-open):not(.is-wa-open){pointer-events:none}
  .v2-site .v2-wa.is-dial-ready:not(.is-dial-open) .v2-dial__items>*{visibility:hidden;opacity:0;transform:translateY(12px) scale(.9)}
  .v2-site .v2-wa.is-wa-open .v2-dial__menu{display:none}
  .v2-site .v2-wa.is-dial-ready .v2-wa__panel{max-height:calc(100dvh - 2 * 56px - 4 * var(--ast-space-4))}
  .v2-site .v2-dial__item{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--ast-border);border-radius:var(--ast-radius-pill);background:var(--ast-surface);color:var(--ast-navy);box-shadow:var(--ast-shadow);font-size:var(--ast-text-sm);font-weight:700;list-style:none;cursor:pointer;touch-action:manipulation}
  .v2-site .v2-dial__item::-webkit-details-marker{display:none}
  .v2-site .v2-dial__menu[open]>.v2-dial__item{border-color:var(--ast-navy);background:var(--ast-navy);color:var(--ast-white)}
  .v2-site .v2-dial__item:focus-visible{outline:3px solid var(--ast-focus);outline-offset:3px}
  .v2-site .v2-dial__menu>.v2-dropdown{position:absolute;top:auto;bottom:0;left:auto;right:calc(100% + var(--ast-space-3));min-width:0;max-width:none;width:min(280px,calc(100vw - 56px - 3 * var(--ast-space-4)));max-height:calc(100dvh - 12rem);overflow:auto;overscroll-behavior:contain;box-shadow:var(--ast-shadow);border-radius:8px}/* taste-skill-ignore: a menu over the page, as DA-12's topbar menu on phones */
}
@media(max-width:767px) and (prefers-reduced-motion:no-preference){
  .v2-site .v2-wa.is-dial-ready .v2-dial__items>*{transition:opacity var(--ast-duration) ease-out,transform var(--ast-duration) ease-out,visibility var(--ast-duration),background-color var(--ast-duration)}
  .v2-site .v2-wa.is-dial-open .v2-dial__items>:nth-child(2){transition-delay:45ms}
  .v2-site .v2-wa.is-dial-open .v2-dial__items>:nth-child(3){transition-delay:90ms}
  .v2-site .v2-wa.is-dial-open .v2-dial__items>*{transition-property:opacity,transform,background-color}
  .v2-site .v2-dial__toggle svg{transition:transform var(--ast-duration)}
}
@media(prefers-reduced-motion:no-preference){
  .v2-site .v2-wa{transition:transform var(--ast-duration)}
  .v2-site .v2-wa__toggle{transition:background-color var(--ast-duration),opacity var(--ast-duration),visibility var(--ast-duration)}
  .v2-site .v2-wa__panel:not([hidden]){animation:v2-wa-in var(--ast-duration) ease-out}
}
@keyframes v2-wa-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
