/* ============================================================
 * FabricsMaker global foundation — Phase 2B (cascade-safe)
 * Owner-approved WP13 Textile Atelier
 *
 * Loaded AFTER fm-child.css as a strictly later overlay.
 * Strategy:
 *   - Remap the existing --fm-* token names declared in WP-1
 *     so every WP-1..WP-9 selector automatically picks up the
 *     Owner-approved Textile Atelier palette via cascade.
 *     No two conflicting brand color systems are left behind.
 *   - Add complementary selectors for presentation concerns
 *     that WP-1..WP-9 did not yet cover: WhatsApp component
 *     contract, header active-state non-color cue, narrow
 *     mobile (<= 320px) refinement, and safe-area handling.
 *   - All color tokens declare a solid-color fallback first
 *     and then an oklch() value for capable browsers.
 *
 * Scope discipline (Phase 2B cascade-safe pass):
 *   - No bare a / a:hover / a:focus.  Link color / underline
 *     applies only to editorial-text scopes.  Universal
 *     a:focus-visible kept for keyboard outline only.
 *   - No bare button / .button / input[type=submit] /
 *     input[type=button].  Button box-model only on .fm-button.
 *   - No bare label / input[type=*] / select / textarea.
 *     Form controls styled only inside .fm-form / .wpcf7-form.
 *   - No bare input:hover / input:focus-visible.  Same scope.
 *   - No checkbox / radio width override outside .fm-form /
 *     .wpcf7-form.  No WooCommerce quantity width override.
 *
 * Hard constraints (project-wide):
 *   - No !important, display:none, visibility:hidden.
 *   - No @font-face, url(), http://, https://, data URI.
 *   - No filter, backdrop-filter, gradient, large shadow.
 *   - No business copy, MOQ, prices, product info.
 *   - No external assets, no remote fonts, no CDN.
 *   - All nav selectors scoped to header.
 *   - No bare `.nav > li > a`, `.sub-menu`, `.nav-dropdown`.
 *   - Does not modify or dequeue parent theme / plugin assets.
 * ============================================================ */

/* ============================================================
 * 1. Token remap: --fm-* names now mean Textile Atelier.
 *    Each color token declares a solid fallback first, then
 *    oklch(). Browsers without oklch use the fallback; capable
 *    browsers use the perceptual color.
 * ============================================================ */
:root {
  /* Surfaces — paper background, linen surface */
  --fm-bg:           #f5eee0;                       /* paper fallback */
  --fm-bg:           oklch(96.44% .014 86.1);        /* paper */
  --fm-surface:      #fbf5e7;
  --fm-surface:      oklch(97.5% .013 87);
  --fm-surface-sunk: #ece2cd;
  --fm-surface-sunk: oklch(91% .022 81.4);

  /* Ink — deep editorial ink, warm muted, soft tertiary */
  --fm-ink:          #2a2924;
  --fm-ink:          oklch(31.16% .005 127.3);
  --fm-ink-muted:    #6a655a;
  --fm-ink-muted:    oklch(48.19% .010 90.1);
  --fm-ink-soft:     #948b7e;

  /* Rules — hairline and stronger rule */
  --fm-rule:         #dad0b9;
  --fm-rule:         oklch(78.83% .025 83.2);
  --fm-rule-strong:  #b9ad99;

  /* Brand accent — Indigo as primary */
  --fm-primary:        #3b4f7a;
  --fm-primary:        oklch(31.95% .047 258.8);
  --fm-primary-soft:   #5a6e98;
  --fm-primary-soft:   oklch(50% .04 258.8);
  --fm-primary-hover:  #2c3e62;
  --fm-primary-hover:  oklch(26% .045 258.8);

  /* Status tokens — Terracotta attention, Forest success */
  --fm-success-token:    #3f6b5b;
  --fm-success-token:    oklch(37.56% .05 164.1);
  --fm-attention-token:  #b35e3c;
  --fm-attention-token:  oklch(49% .122 38.4);

  /* Editorial accents reserved for future semantic use */
  --fm-sage-token:   #c7d3a8;
  --fm-sage-token:   oklch(82% .045 123.8);
  --fm-coral-token:  #d97757;
  --fm-coral-token:  oklch(67% .137 34.0);

  /* Shadow — restrained editorial depth only */
  --fm-shadow-1: 0 1px 2px rgba(31, 29, 26, 0.05);
  --fm-shadow-2: 0 4px 14px rgba(31, 29, 26, 0.06);

  /* Radius — low-saturation, almost square editorial */
  --fm-radius-sm: 2px;
  --fm-radius-md: 4px;
  --fm-radius-lg: 8px;

  /* Spacing scale (rem, 4px base) — preserved from WP-1 */
  --fm-space-1: 0.25rem;
  --fm-space-2: 0.5rem;
  --fm-space-3: 0.75rem;
  --fm-space-4: 1rem;
  --fm-space-5: 1.5rem;
  --fm-space-6: 2rem;
  --fm-space-7: 3rem;
  --fm-space-8: 4rem;

  /* Layout — comfortable editorial column */
  --fm-content-max: 72rem;

  /* Type stacks — system fonts only */
  --fm-font-serif: "Iowan Old Style", Baskerville, "Apple Garamond",
                   Georgia, serif;
  --fm-font-sans:  "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --fm-font-mono:  Menlo, "SFMono-Regular", ui-monospace, monospace;

  /* Type scale — clamp() for fluid responsive headings */
  --fm-text-xs:   0.75rem;
  --fm-text-sm:   0.875rem;
  --fm-text-base: 1rem;
  --fm-text-md:   1.125rem;
  --fm-text-lg:   1.25rem;
  --fm-text-xl:   clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fm-text-2xl:  clamp(1.5rem,  1.3rem + 0.9vw, 1.875rem);
  --fm-text-3xl:  clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem);
  --fm-text-4xl:  clamp(2.25rem, 1.8rem + 2.2vw, 3.25rem);

  /* Editorial display scale — used for masthead / hero only */
  --fm-text-display:   clamp(2.5rem, 1.6rem + 3.4vw, 3.75rem);
  --fm-text-section:   clamp(2rem,   1.4rem + 2.4vw, 2.75rem);
  --fm-text-subhead:   clamp(1.4rem, 1.15rem + 1vw, 1.75rem);

  /* Line height — editorial rhythm */
  --fm-leading-tight:  1.2;
  --fm-leading-snug:   1.35;
  --fm-leading-normal: 1.6;
  --fm-leading-loose:  1.75;

  /* Letter spacing — only for meta / kicker */
  --fm-tracking-meta: 0.06em;

  /* Motion tokens */
  --fm-ease-out:    cubic-bezier(.22,1,.36,1);
  --fm-ease-in:     cubic-bezier(.55,0,1,.45);
  --fm-ease-in-out: cubic-bezier(.65,0,.35,1);
  --fm-dur-short:   160ms;
  --fm-dur-entry:   600ms;

  /* Layer tokens — explicit, controlled stacking */
  --fm-layer-content: 1;
  --fm-layer-header:  20;
  --fm-layer-dropdown: 30;
  --fm-layer-modal:    40;
  --fm-layer-skip:     60;
  --fm-layer-float:    80;

  /* Control heights — accessibility contract */
  --fm-control-min: 44px;
  --fm-control-cta: 48px;

  /* Gutters — fluid editorial gutter */
  --fm-gutter: clamp(1.25rem, 4.5vw, 5rem);

  /* Brand lockup — the width expression for the logo lockup.
   *
   * R5_1 / issue 1. The FabricsMaker Corporate Identity System V2
   * ("空间与尺寸" / space and size) states that the complete digital
   * wordmark should be no smaller than 160px wide. The old masthead
   * rule sized the logo with `max-width: min(15rem, 48vw)`, so a
   * 320px viewport rendered it at 153px — below the brand minimum —
   * while a desktop viewport rendered it at 240px and the footer
   * rendered it at 192px. Three different sizes for one lockup.
   *
   * 15rem = 240px is one value, used by the header and the footer,
   * on every viewport. `max-width: 100%` lets it give way on a
   * 320px screen instead of overflowing, and because the image is
   * scaled proportionally it never drops below the brand minimum
   * in practice (the narrowest real case is ~204px).
   *
   * R5-7 — the remaining 320px difference is closed. The masthead
   * row and the footer row have the same content width, so ONE
   * expression gives both surfaces the identical lockup:
   *
   *   15rem (240px) whenever the row can hold it, otherwise the
   *   space that is actually free:
   *       row content width - menu button (3.5rem) - row gap (1.25rem)
   *
   * At a 320px viewport that is 280 - 56 - 20 = 204px, on the
   * header and on the footer alike. At 360px and above the row can
   * hold 240px and both surfaces stay at 240px. Below 356px the
   * masthead row cannot hold 240px at all, so the lockup shrinks
   * with the row and the two surfaces can never drift apart.
   *
   * The percentage is resolved against the row the lockup sits in,
   * so the token is used on the two brand containers
   * (.fm-brand, .fm-footer-brand-link); the images themselves are
   * sized at 100% of those containers.
   *
   * R5-UX-05 (2026-10-27) — the header lockup is enlarged and the
   * footer lockup is left exactly as it is, so the one token below is
   * now the FOOTER width and the masthead scope re-points it at a
   * larger value (assets/css/shell.css). The token and the expression
   * behind it are unchanged: the 160px brand floor, the give-way
   * behaviour on a narrow screen and the proportional scaling all
   * still hold.
   */
  --fm-masthead-toggle-width: 3.5rem;
  --fm-masthead-gap: 1.25rem;
  --fm-logo-width: min(15rem, calc(100% - var(--fm-masthead-toggle-width) - var(--fm-masthead-gap)));
}

/* ============================================================
 * 2. Body background, foreground, base selection.
 *    The body element is a presentation target, not a content
 *    element — setting its surface / ink color is part of the
 *    editorial paper system.  ::selection keeps the warm
 *    paper-on-indigo pairing.
 * ============================================================ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: var(--fm-bg);
  color: var(--fm-ink);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  line-height: var(--fm-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background-color: var(--fm-primary-soft);
  color: var(--fm-surface);
}

/* ============================================================
 * 3. Typography contract — ordinary headings plus explicit
 *    display / section / subhead tiers.  Flatsome Theme Options
 *    emit dynamic font declarations, so this late-loaded layer
 *    re-anchors ordinary headings while preserving .alt-font.
 * ============================================================ */
body h1:not(.alt-font),
body h2:not(.alt-font),
body h3:not(.alt-font),
body h4:not(.alt-font),
body h5:not(.alt-font),
body h6:not(.alt-font),
body .heading-font:not(.alt-font),
body .banner h1:not(.alt-font),
body .banner h2:not(.alt-font) {
  font-family: var(--fm-font-serif);
  font-weight: 500;
  line-height: var(--fm-leading-tight);
}

/* Flatsome may place .alt-font on the heading itself or on an ancestor.
 * Directly marked headings are excluded above; descendant headings inherit
 * the ancestor's dynamically configured font without fixing its family here.
 */
body .alt-font h1,
body .alt-font h2,
body .alt-font h3,
body .alt-font h4,
body .alt-font h5,
body .alt-font h6,
body .alt-font .heading-font,
body .banner .alt-font h1,
body .banner .alt-font h2 {
  font-family: inherit;
}

.fm-display,
.fm-section-title,
.fm-subhead {
  font-family: var(--fm-font-serif);
  color: var(--fm-ink);
  font-weight: 500;
  line-height: var(--fm-leading-tight);
  letter-spacing: -0.005em;
  margin: 0 0 var(--fm-space-4);
}
.fm-display       { font-size: var(--fm-text-display); }
.fm-section-title { font-size: var(--fm-text-section); }
.fm-subhead       { font-size: var(--fm-text-subhead); }

.fm-kicker {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--fm-tracking-meta);
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-2);
  display: block;
}

.fm-meta,
.fm-spec {
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  color: var(--fm-ink-muted);
  letter-spacing: 0.02em;
}

/* Navigation typography only; layout and interactions stay with Flatsome. */
.header .nav > li > a,
.header .nav-dropdown > li > a,
.header .sub-menu > li > a,
.header .header-search,
.header .header-cart-link,
.header .nav-icon,
.off-canvas .nav > li > a,
.off-canvas .sub-menu > li > a,
.mobile-sidebar .nav > li > a {
  font-family: var(--fm-font-sans);
}

/* Screen-reader-only utility — standard single pattern.  Used
   only in explicitly-defined accessible contexts; never as a
   way to hide real content from sighted users. */
.fm-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;
}

/* ============================================================
 * 4. Link rules — strictly scoped to editorial-text contexts.
 *
 *    No bare `a { }` or `a:hover { }`.  Color / underline
 *    applies only to inline editorial-text scopes.  Bare
 *    structure links (header nav, footer nav, product cards,
 *    images, icons, social icons, cart / account / search
 *    icons, logo, .button) are intentionally untouched and
 *    keep whatever color / underline their parent surface
 *    gave them.  WP-1..WP-9 already owns the per-surface link
 *    colors (header / footer / WooCommerce).  This Foundation
 *    only adds the editorial-text rules that the WP-1..WP-9
 *    files do not cover.
 *
 *    A single universal a:focus-visible rule is kept for the
 *    keyboard outline only — it sets outline and offset and
 *    does not touch color, background, layout, or underline.
 * ============================================================ */
a:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
  border-radius: var(--fm-radius-sm);
}

/* Editorial inline link — runs of body text only.  Excludes
   .button so CTA styling is never accidentally overridden. */
.fm-richtext a:not(.button),
.entry-content p a:not(.button),
.entry-content li a:not(.button),
.text-inner p a:not(.button),
.text-inner li a:not(.button),
.woocommerce-product-details__short-description a:not(.button),
.woocommerce-Tabs-panel a:not(.button) {
  color: var(--fm-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition:
    color var(--fm-dur-short) var(--fm-ease-out),
    text-decoration-thickness var(--fm-dur-short) var(--fm-ease-out);
}
.fm-richtext a:not(.button):hover,
.entry-content p a:not(.button):hover,
.entry-content li a:not(.button):hover,
.text-inner p a:not(.button):hover,
.text-inner li a:not(.button):hover,
.woocommerce-product-details__short-description a:not(.button):hover,
.woocommerce-Tabs-panel a:not(.button):hover {
  color: var(--fm-primary-hover);
  text-decoration-thickness: 2px;
}

/* ============================================================
 * 5. Button rules — project-prefix only.
 *
 *    No bare `button`, `.button`, `input[type=submit]`, or
 *    `input[type=button]`.  Those selectors are owned by WP-2
 *    for real Flatsome / WooCommerce / quantity / slider /
 *    quick-view / cart / checkout / account buttons, and they
 *    inherit the new palette via the token remap in :root.
 *
 *    Re-declaring the full box model here would overwrite the
 *    quantity +/- buttons, slider arrows, and other plugin
 *    controls that legitimately look like buttons.
 *
 *    Project buttons opt in explicitly with .fm-button and
 *    get the Indigo box model.  The 48px CTA contract is
 *    available on .fm-button.is-primary only.
 * ============================================================ */
.fm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--fm-control-min);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  font-weight: 500;
  line-height: 1.2;
  padding: var(--fm-space-3) var(--fm-space-5);
  border-radius: var(--fm-radius-md);
  border: 1px solid var(--fm-primary);
  background-color: var(--fm-primary);
  color: var(--fm-surface);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--fm-dur-short) var(--fm-ease-out),
    border-color var(--fm-dur-short) var(--fm-ease-out),
    color var(--fm-dur-short) var(--fm-ease-out);
}
.fm-button:hover {
  background-color: var(--fm-primary-hover);
  border-color: var(--fm-primary-hover);
  color: var(--fm-surface);
  text-decoration: none;
}
.fm-button:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}

/* Primary CTA — 48px contract */
.fm-button.is-primary {
  min-height: var(--fm-control-cta);
}

/* Secondary / outline — paper surface, indigo border & text */
.fm-button.is-secondary {
  background-color: transparent;
  color: var(--fm-primary);
  border-color: var(--fm-primary);
}
.fm-button.is-secondary:hover {
  background-color: var(--fm-primary);
  color: var(--fm-surface);
  border-color: var(--fm-primary);
}

/* Disabled — visibly inactive, never hidden */
.fm-button:disabled,
.fm-button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: var(--fm-surface-sunk);
  border-color: var(--fm-rule);
  color: var(--fm-ink-muted);
}

/* ============================================================
 * 6. Form controls — scoped to .fm-form and .wpcf7-form only.
 *
 *    No bare `label`, `input[type=*]`, `select`, `textarea`,
 *    `input:hover`, `input:focus-visible`, or bare checkbox /
 *    radio rules.  The bare form selectors are owned by WP-1
 *    and WP-2 for WooCommerce quantity / checkout / account /
 *    cart / Header search inputs.  This Foundation only adds
 *    Textile Atelier styling to project-defined forms.
 *
 *    The new rules NEVER match .woocommerce-cart-form,
 *    .woocommerce-checkout, .woocommerce-account, .quantity,
 *    Header search, plugin drawer controls, or any other
 *    non-project form.  No width / padding / min-height
 *    override on WooCommerce quantity is introduced.
 * ============================================================ */
.fm-form label,
.wpcf7-form label {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  font-weight: 500;
  color: var(--fm-ink);
  line-height: var(--fm-leading-snug);
  display: inline-block;
  margin-bottom: var(--fm-space-1);
}

.fm-form input[type="text"],
.fm-form input[type="email"],
.fm-form input[type="url"],
.fm-form input[type="tel"],
.fm-form input[type="search"],
.fm-form input[type="number"],
.fm-form input[type="password"],
.fm-form select,
.fm-form textarea,
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="search"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="password"],
.wpcf7-form select,
.wpcf7-form textarea {
  min-height: var(--fm-control-min);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  background-color: var(--fm-surface);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  padding: var(--fm-space-2) var(--fm-space-3);
  width: 100%;
  max-width: 32rem;
  transition: border-color var(--fm-dur-short) var(--fm-ease-out);
}
.fm-form textarea,
.wpcf7-form textarea {
  min-height: calc(var(--fm-control-min) * 2);
  resize: vertical;
}
.fm-form input:hover,
.fm-form select:hover,
.fm-form textarea:hover,
.wpcf7-form input:hover,
.wpcf7-form select:hover,
.wpcf7-form textarea:hover {
  border-color: var(--fm-rule-strong);
}
.fm-form input:focus-visible,
.fm-form select:focus-visible,
.fm-form textarea:focus-visible,
.wpcf7-form input:focus-visible,
.wpcf7-form select:focus-visible,
.wpcf7-form textarea:focus-visible {
  border-color: var(--fm-primary);
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}

.fm-form input[type="checkbox"],
.fm-form input[type="radio"],
.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] {
  accent-color: var(--fm-primary);
  width: 18px;
  height: 18px;
}
.fm-form input[type="checkbox"]:focus-visible,
.fm-form input[type="radio"]:focus-visible,
.wpcf7-form input[type="checkbox"]:focus-visible,
.wpcf7-form input[type="radio"]:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}

/* Field hint, helper, error text — semantic states.  Scoped to
   project forms; never bleeds into WooCommerce. */
.fm-form .fm-field-hint,
.wpcf7-form .fm-field-hint {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  color: var(--fm-ink-muted);
  margin-top: var(--fm-space-1);
}
.fm-form .fm-field-error,
.wpcf7-form .fm-field-error {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  color: var(--fm-attention-token);
  margin-top: var(--fm-space-1);
}
.fm-form .fm-field-success,
.wpcf7-form .fm-field-success {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  color: var(--fm-success-token);
  margin-top: var(--fm-space-1);
}

/* ============================================================
 * 7. Header — editorial masthead refinements that complement
 *    WP-4 without duplicating it.  WP-4 already owns the
 *    surface, main nav links, hover, focus, current state,
 *    dropdowns, and header utility icons.
 *
 *    This block adds:
 *      (a) Non-color identification on active / current state
 *          (1px indigo rule) so color-blind users see the cue.
 *      (b) Hairline between header utility items.
 *      (c) Reduced-motion disable for header-added transitions.
 *
 *    All selectors are header-scoped.  NEVER use bare
 *    .nav > li > a, .sub-menu, .nav-dropdown.  NEVER restore
 *    the previously deleted .header .button transparent
 *    override.  Footer / sidebar / widgets untouched.
 * ============================================================ */
.header .current-menu-item > a,
.header .current-menu-parent > a,
.header .active > a {
  border-bottom: 1px solid var(--fm-primary);
}

.header .header-utils {
  display: inline-flex;
  align-items: center;
  gap: var(--fm-space-3);
}
.header .header-utils > * + * {
  border-left: 1px solid var(--fm-rule);
  padding-left: var(--fm-space-3);
}

@media (prefers-reduced-motion: reduce) {
  .header a,
  .header .nav > li > a,
  .header .sub-menu > li > a,
  .header .nav-dropdown > li > a,
  .header .header-search,
  .header .header-cart-link,
  .header .nav-icon {
    transition: none;
  }
}

/* ============================================================
 * 8. Footer — editorial colophon chapter-mark rule.
 *    WP-9 already owns the terminal backdrop, widget-title
 *    typography, paragraph / textwidget / link / form / social
 *    icons / absolute-footer.  This block adds a 32×1px
 *    chapter mark above each widget title.  Does NOT touch
 *    sidebar / header / non-footer widgets.
 * ============================================================ */
#footer .widget-title::before,
.footer-wrapper .widget-title::before {
  content: "";
  display: block;
  width: 32px;
  height: 1px;
  background-color: var(--fm-rule);
  margin-bottom: var(--fm-space-3);
}

/* ============================================================
 * 9. WhatsApp float — explicit component contract.
 *    A0 did NOT find a verifiable third-party WhatsApp DOM
 *    selector.  This block defines ONLY the contract surface.
 *    It does NOT inject a phone number, URL, label, or icon.
 *    It does NOT create DOM.  It does NOT add third-party
 *    scripts.  A future WordPress configuration / markup task
 *    is responsible for binding real WhatsApp content to the
 *    .fm-whatsapp-float* classes.
 * ============================================================ */
.fm-whatsapp-float {
  position: fixed;
  inset-inline-end: var(--fm-space-4);
  inset-block-end: var(--fm-space-4);
  z-index: var(--fm-layer-float);
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.fm-whatsapp-float__link {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--fm-space-2);
  min-width: var(--fm-control-cta);
  min-height: var(--fm-control-cta);
  padding: var(--fm-space-2) var(--fm-space-4);
  background-color: var(--fm-surface);
  color: var(--fm-primary);
  border: 1px solid var(--fm-rule-strong);
  border-radius: var(--fm-radius-md);
  text-decoration: none;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  font-weight: 500;
  line-height: 1.2;
  box-shadow: var(--fm-shadow-1);
  transition:
    color var(--fm-dur-short) var(--fm-ease-out),
    border-color var(--fm-dur-short) var(--fm-ease-out),
    background-color var(--fm-dur-short) var(--fm-ease-out);
}

.fm-whatsapp-float__link:hover {
  color: var(--fm-primary-hover);
  border-color: var(--fm-primary);
  background-color: var(--fm-surface);
}

.fm-whatsapp-float__link:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}

.fm-whatsapp-float__icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.fm-whatsapp-float__label {
  display: inline-block;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  color: inherit;
}

@supports (padding: max(0px)) {
  .fm-whatsapp-float {
    inset-inline-end: max(var(--fm-space-4), env(safe-area-inset-right));
    inset-block-end: max(var(--fm-space-4), env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fm-whatsapp-float__link {
    transition: none;
  }
}

/* ============================================================
 * 10. Responsive foundation — narrow mobile (≤ 360px).
 *     WP-1..WP-9 already cover max-width: 640px in their
 *     respective sections.  This block tightens to the narrow
 *     viewport edge cases so 320px devices never produce
 *     horizontal overflow or oversized touch targets.  No
 *     display:none / visibility:hidden tricks.
 * ============================================================ */
@media (max-width: 360px) {
  body {
    font-size: 0.9375rem;
  }

  .fm-whatsapp-float__link {
    min-width: var(--fm-control-min);
    min-height: var(--fm-control-min);
    padding: var(--fm-space-2);
  }

  .fm-display       { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.5rem); }
  .fm-section-title { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
  .fm-subhead       { font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.5rem); }
}

/* ============================================================
 * 11. Reduced motion — token rewrite only.
 *     WP-1 already provides the global universal override
 *     (with !important) for animation and transition.  This
 *     block rewrites --fm-dur-short / --fm-dur-entry to 0ms
 *     so any component-level transition that references the
 *     tokens also stops — without adding any new !important.
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --fm-dur-short: 0ms;
    --fm-dur-entry: 0ms;
  }
}
