/* Sleeping Organic site palette: Evergreen + Honey (owner 2026-10-29, local sandbox review).
   One green across the whole site (the builder's #1f3026 instead of the theme's #2d3f2a), moss for buttons and
   links, sage for secondary, honey for eyebrows / savings / stars, pale gold for buttons on dark bands, cream and
   warm white for section rhythm. Footer goes from near-black to the same deep green as the builder receipt.
   Loaded after every theme stylesheet on the clone; nothing here ships to production as-is. */

:root {
  --so-green-dark: #1f3026;
  --so-green: #4a654d;
  --so-green-light: #627d65;
  --so-cream: #faf9f6;
  --so-warm: #f4f0e8;
  --so-text: #1f2a22;
  --so-text-muted: #59655d;
  --so-text-light: #8a948d;
  --so-border: #e4dfd4;
  --so-gold: #b8976a;
  --so-honey: #8a6a2f;
  --so-honey-bg: #f6efe2;
  --so-gold-pale: #d9c38a;
  --so-bg-warm: #faf9f6;
  --so-moss-bg: #ecf0ea;
  --so-footer: #1f3026;
  --so-footer-deep: #172419;
  --so-footer-line: #33463a;
  --soai-color: #1f3026;
}

/* ---------- Header chrome ---------- */
.so-topbar { background: var(--so-footer-deep); color: #e9e4d6; }
.so-topbar a { color: #fff; }
.so-header { background: #fff; border-bottom-color: var(--so-border); }
.so-nav-link { color: var(--so-text); }
.so-nav-link:hover, .so-nav-item.is-open > .so-nav-link, .so-nav-item:hover > .so-nav-link { color: var(--so-green); }
.so-nav-link::after { background: var(--so-green); }
.so-nav-item:last-child > .so-nav-link, .so-nav-link.so-nav-link--sale { color: var(--so-honey); }
.so-cart-link:hover { color: var(--so-green); }
.so-cart-count { background: var(--so-honey); color: #fff; }
.so-dropdown { border-color: var(--so-border); }
.so-mega-heading, .so-mega-feature__eyebrow { color: var(--so-honey); }
.so-mega-feature__cta { color: var(--so-green); }

/* Sale strip: flat moss instead of the four-stop gradient; sign-up in pale gold like the builder's button on dark */
.so-action-bar { background: var(--so-green); color: #fff; }
.so-ab-email-btn, .so-ab-email-btn:hover { background: var(--so-gold-pale); color: var(--so-green-dark); border-color: var(--so-gold-pale); }
.so-ab-coupon-code { background: rgba(255,255,255,.14); color: #fff; }
/* Countdown labels (DAYS, HRS...): 60% white on the green measured 3.47:1 on live; this is 5.4:1. */
.so-ab-unit small { opacity: 1; color: #e6ece6; }
/* Same labels on the countdown under Add to cart: #888 on the cream bar measured 3.33:1; this is 5.5:1. */
.so-countdown .so-cd-unit small { color: #5d6a61; }

/* ---------- Type, links, eyebrows ---------- */
body { color: var(--so-text); }
/* Headings keep the theme's text token (now green-black); no global recolor, dark bands stay white. */
a { color: var(--so-green-dark); }
a:hover { color: var(--so-green); }
.so-eyebrow, .postid-71611 .so-mx-eyebrow, .so-page-hero .so-eyebrow { color: var(--so-honey); }
.so-split-section--dark .so-eyebrow, .so-section--dark .so-eyebrow { color: var(--so-gold-pale); }
.so-trust-dot { background: var(--so-honey); }
.so-section--trust-strip { background: var(--so-warm); }
.so-testimonial-card .so-stars, .so-testimonial-stars, .so-review-stars { color: var(--so-gold); }

/* ---------- Buttons ---------- */
.so-btn, .so-btn-primary, .so-btn-sm,
#so-hero-cta, .so-btn-green,
.single_add_to_cart_button, .single_add_to_cart_button.button, .single_add_to_cart_button.alt,
.woocommerce .button.alt, .woocommerce button.button.alt, .woocommerce #place_order,
.checkout-button, .wc-proceed-to-checkout a.button {
  background: var(--so-green-dark) !important; background-color: var(--so-green-dark) !important; color: #fff !important; border-color: var(--so-green-dark) !important;
}
.so-btn:hover, .so-btn-primary:hover, .so-btn-sm:hover, #so-hero-cta:hover, .so-btn-green:hover,
.single_add_to_cart_button:hover, .woocommerce .button.alt:hover, .woocommerce #place_order:hover,
.checkout-button:hover, .wc-proceed-to-checkout a.button:hover {
  background: var(--so-green) !important; background-color: var(--so-green) !important; color: #fff !important; border-color: var(--so-green) !important;
}
/* Buttons on dark bands: pale gold on green, the builder's receipt button */
.so-section--dark .so-btn-white, .so-split-section--dark .so-btn-white, .so-btn-white {
  background: var(--so-gold-pale) !important; color: var(--so-green-dark) !important; border-color: var(--so-gold-pale) !important; box-shadow: none !important;
}
.so-section--dark .so-btn-white:hover, .so-split-section--dark .so-btn-white:hover, .so-btn-white:hover { background: #e6d4a3 !important; color: var(--so-green-dark) !important; }
.so-section--dark a, .so-split-section--dark a { color: #fff; }
.so-section--dark, .so-split-section--dark { background: var(--so-green-dark); }
.so-section--warm { background: var(--so-warm); }
.so-section--cream, .light { background: var(--so-cream); }

.so-final-cta .so-hero-cta, .so-final-cta .so-hero-cta:hover { background: var(--so-gold-pale) !important; color: var(--so-green-dark) !important; }
.so-final-cta .so-hero-cta:hover { background: #e6d4a3 !important; }

/* Comparison tables, prices, small accents */
.so-vs-table th, .so-compare-table th, .so-comparison-table th, table.so-vs thead th { background: var(--so-green-dark); color: #fff; }
.so-product-price, .so-starting-at, .so-card-price { color: var(--so-honey); }
.so-shop-link:hover { border-bottom-color: var(--so-green); }

/* ---------- Footer: from near-black to the site green ---------- */
.so-footer { background: var(--so-footer); color: rgba(247,243,234,.72); }
.so-footer a { color: rgba(247,243,234,.72); }
.so-footer a:hover { color: #fff; }
.so-footer-heading { color: var(--so-gold-pale); }
.so-footer-certs { border-color: var(--so-footer-line); }
.so-footer-certs img { opacity: .8; }
.so-footer-affirm-disclosure { border-color: var(--so-footer-line); }
.so-footer-bottom { background: var(--so-footer-deep); border-top-color: var(--so-footer-line); color: rgba(247,243,234,.55); }
.so-footer-payments span, .so-footer-payments li { background: rgba(255,255,255,.08); color: rgba(247,243,234,.7); }

/* ---------- Cart and checkout ---------- */
.woocommerce-cart .cart_totals, .woocommerce-cart .so-cart-summary { background: var(--so-cream); border-color: var(--so-border); }
.woocommerce-cart .so-cart-line-current, .woocommerce-cart .so-cart-subtotal-current { color: var(--so-green-dark); }
.woocommerce-cart tr.cart-discount th, .woocommerce-cart tr.cart-discount td { color: var(--so-honey); }

/* ---------- Chat launcher ---------- */
#soai-chat-bubble { color: var(--so-green-dark); border-color: var(--so-green-dark); }
#soai-chat-bubble::after { border-color: var(--so-green-dark); }

/* ---------- Mattress page (rebuild) ---------- */
body.postid-71611 .so-mx-section--dark, body.postid-71611 .so-mx-dark { background: var(--so-green-dark); }
body.postid-71611 .so-mx-tip a, body.postid-71611 .so-mx-build-card a, body.postid-71611 .so-mx-certs-intro a, body.postid-71611 .so-mx-table-note a { color: var(--so-green); }
body.postid-71611 .so-mx-scale strong { color: var(--so-green-dark); }
body.postid-71611 .so-mx-size-table td:nth-child(2) { color: var(--so-green-dark); }

/* ---------- Builder: Evergreen receipt, Honey warmth (merge of options 1 and 2) ---------- */
body #woomax-builder.wm-v2 {
  --wm-ink: #1f3026; --wm-sage: #627d65; --wm-line: #e4dfd4; --wm-warm: #fbfaf6; --wm-cream: #f6f1e6;
  --wm-text: #3f4a43; --wm-muted: #657067; --wm-accent: #8a6a2f; --wm-accent-bg: #f3e8cc; --wm-tint: #e8eee6; --wm-tint-ink: #3f5e45;
  --wm-select: #4a654d; --wm-select-bg: #e6ede4; --wm-check: #4a654d; --wm-cta: #d9c38a; --wm-cta-ink: #1f3026; --wm-field: #cfdacf; --wm-card: #fbf9f3;
  --wm-stack1: #f3ead2; --wm-stack2: #e6d6ad; --wm-stack3: #cfb680;
  --wm-receipt-bg: #1f3026; --wm-receipt-ink: #f7f3ea; --wm-receipt-muted: #b9c6bb; --wm-receipt-line: #35483c; --wm-receipt-title: #d9c38a; --wm-receipt-save: #e3cf93;
  color: var(--wm-text);
}
body #woomax-builder.wm-v2 .woomax-step-number { color: var(--wm-accent); }
body #woomax-builder.wm-v2 .woomax-step-number::after { background: var(--wm-accent); opacity: .5; }
body #woomax-builder.wm-v2 .woomax-step-optional, body #woomax-builder.wm-v2 .wm-v2-step-meta, body #woomax-builder.wm-v2 .woomax-option-desc, body #woomax-builder.wm-v2 .wm-v2-dimensions,
body #woomax-builder.wm-v2 .wm-v2-layer-role, body #woomax-builder.wm-v2 .woomax-base-size, body #woomax-builder.wm-v2 .woomax-bundle-size, body #woomax-builder.wm-v2 .woomax-base-desc,
body #woomax-builder.wm-v2 .woomax-base-none, body #woomax-builder.wm-v2 .woomax-pillows-value, body #woomax-builder.wm-v2 .woomax-pillows-decline, body #woomax-builder.wm-v2 .wm-v2-phone small { color: var(--wm-muted); }
body #woomax-builder.wm-v2 .woomax-original-price { color: var(--wm-muted) !important; }
body #woomax-builder.wm-v2 .woomax-bundle-card { background: var(--wm-card); }
body #woomax-builder.wm-v2 .woomax-bundle-card:hover { background: #fff; border-color: var(--wm-select); }
body #woomax-builder.wm-v2 .woomax-bundle-card.selected { background: var(--wm-select-bg); border-color: var(--wm-select); box-shadow: 0 10px 28px -14px rgba(74,101,77,.35); }
body #woomax-builder.wm-v2 .woomax-bundle-card.selected .woomax-option-price, body #woomax-builder.wm-v2 .woomax-bundle-card.selected .wm-v2-inch { color: var(--wm-ink); }
body #woomax-builder.wm-v2 .woomax-bundle-card::after, body #woomax-builder.wm-v2 .woomax-pillows-decline::after { border-color: var(--wm-line); }
body #woomax-builder.wm-v2 .woomax-bundle-card.selected::after, body #woomax-builder.wm-v2 .woomax-pillows-decline.active::after { background: var(--wm-check); border-color: var(--wm-check); }
body #woomax-builder.wm-v2 .wm-v2-stack i { background: var(--wm-stack1); } body #woomax-builder.wm-v2 .wm-v2-stack i:nth-child(2) { background: var(--wm-stack2); } body #woomax-builder.wm-v2 .wm-v2-stack i:nth-child(3) { background: var(--wm-stack3); }
body #woomax-builder.wm-v2 .woomax-value-badge { background: var(--wm-accent); color: #fff; }
body #woomax-builder.wm-v2 .woomax-popular-badge, body #woomax-builder.wm-v2 .woomax-pillows-badge { background: var(--wm-check) !important; }
body #woomax-builder.wm-v2 .wm-v2-chip, body #woomax-builder.wm-v2 .woomax-sub-pill.selected { background: var(--wm-tint); color: var(--wm-tint-ink); }
body #woomax-builder.wm-v2 .woomax-pillows-card { background: var(--wm-select-bg); border-color: var(--wm-select); }
body #woomax-builder.wm-v2 .wlayer-row { background: var(--wm-card); }
body #woomax-builder.wm-v2 .wlayer-dropdown-trigger { background: #fff; border-color: var(--wm-field); }
body #woomax-builder.wm-v2 .wlayer-dropdown-panel, body #woomax-builder.wm-v2 .woomax-sub-options, body #woomax-builder.wm-v2 .wm-v2-purchase .qty { border-color: var(--wm-field); }
body #woomax-builder.wm-v2 .woomax-split-active { background: var(--wm-select); }
body #woomax-builder.wm-v2 .woomax-base-badge { color: var(--wm-accent); }
body #woomax-builder.wm-v2 .woomax-base-none.selected, body #woomax-builder.wm-v2 .woomax-pillows-decline.active { background: var(--wm-select-bg); border-color: var(--wm-select); }
body #woomax-builder.wm-v2 .woomax-price-summary { background: var(--wm-receipt-bg); color: var(--wm-receipt-ink); }
body #woomax-builder.wm-v2 .wm-v2-receipt-title, body #woomax-builder.wm-v2 .so-loadup-services__head { color: var(--wm-receipt-title); }
body #woomax-builder.wm-v2 .wm-v2-receipt { border-bottom-color: var(--wm-receipt-line); }
body #woomax-builder.wm-v2 .wm-v2-receipt dt, body #woomax-builder.wm-v2 .woomax-total > span:first-child, body #woomax-builder.wm-v2 .woomax-trust-badge, body #woomax-builder.wm-v2 .so-refine-build-caption { color: var(--wm-receipt-muted); }
body #woomax-builder.wm-v2 .wm-v2-receipt > div:first-child dt, body #woomax-builder.wm-v2 .wm-v2-receipt dd, body #woomax-builder.wm-v2 #woomax-total-price, body #woomax-builder.wm-v2 .woomax-trust-badge:hover { color: var(--wm-receipt-ink); }
body #woomax-builder.wm-v2 .woomax-total .woomax-original-price, body #woomax-builder.wm-v2 #woomax-total-price .woomax-original-price { color: var(--wm-receipt-muted) !important; }
body #woomax-builder.wm-v2 .wm-v2-savings { color: var(--wm-receipt-save); }
body #woomax-builder.wm-v2 .so-loadup-services__head { color: #4a654d; }
body #woomax-builder.wm-v2 .single_add_to_cart_button, body #woomax-builder.wm-v2 .wm-v2-phone button { background: var(--wm-cta) !important; color: var(--wm-cta-ink) !important; border-color: var(--wm-cta) !important; }
body #woomax-builder.wm-v2 :is(button,input,select,a):focus-visible { outline-color: var(--wm-select); }

/* ── Site-wide headline type (site audit 2026-11-10, design plan 1.1). Sandbox only, like the rest of this file.
   The rebuilt mattress page set the pattern: Georgia headlines, Gelasio where Georgia is missing (Android).
   H1 and H2 only; H3 and below stay Inter so cards, forms and menus keep their crisp labels. ── */
@font-face {
  font-family: Gelasio; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/wp-content/themes/sleeping-organic/fonts/gelasio-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root { --so-font-display: Georgia, Gelasio, "Times New Roman", serif; }
body :is(h1, h2) { font-family: var(--so-font-display); font-weight: 400; letter-spacing: -.01em; }
body :is(h3, h4, h5, h6) { font-family: var(--so-font); }

/* ---------- Design plan 1.2: content tables on phones ---------- */
.so-tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
@media (max-width: 600px) {
  .so-tbl-scroll > table { min-width: 34rem; }
  .so-tbl-scroll th, .so-tbl-scroll td, table th, table td { word-break: normal; overflow-wrap: normal; hyphens: none; }
  table.so-tbl-cards { border: 0 !important; background: transparent !important; box-shadow: none !important; min-width: 0 !important; width: 100% !important; display: block !important; }
  table.so-tbl-cards > thead, table.so-tbl-cards tr.so-tbl-head { display: none !important; }
  table.so-tbl-cards > tbody, table.so-tbl-cards > tbody > tr,
  table.so-tbl-cards > tbody > tr > th, table.so-tbl-cards > tbody > tr > td { box-sizing: border-box; display: block !important; width: 100% !important; }
  table.so-tbl-cards > tbody > tr { background: #fff !important; border: 1px solid #dfe2da !important; border-radius: 6px; margin: 0 0 .7rem; overflow: hidden; }
  table.so-tbl-cards > tbody > tr > .so-tbl-title { background: #f4f0e8 !important; border: 0 !important; border-bottom: 1px solid #e4dfd4 !important; color: #1f3026 !important; font-size: .95rem !important; font-weight: 700 !important; line-height: 1.35; padding: .65rem .9rem !important; text-align: left !important; text-transform: none !important; letter-spacing: 0 !important; }
  table.so-tbl-cards > tbody > tr > [data-label] { background: transparent !important; border: 0 !important; border-bottom: 1px solid #eef0ea !important; color: #33443a !important; font-size: .95rem !important; line-height: 1.45; padding: .55rem .9rem .6rem !important; text-align: left !important; }
  table.so-tbl-cards > tbody > tr > [data-label]:last-child { border-bottom: 0 !important; }
  /* Label left, value right on one row: about half the height of label-above-value. */
  table.so-tbl-cards > tbody > tr > [data-label] { align-items: baseline; column-gap: .6rem; display: flex !important; padding: .5rem .9rem !important; }
  table.so-tbl-cards > tbody > tr > [data-label]::before { color: #5f6862; content: attr(data-label); flex: 0 0 40%; max-width: 40%; white-space: normal; font-size: .78rem; font-weight: 700; line-height: 1.4; position: static !important; width: auto !important; letter-spacing: 0 !important; text-transform: none !important; }
  /* ^ static: a page stylesheet that positions its own label absolutely (foundation comparison) must not overlap the value. */
  table.so-tbl-cards > tbody > tr > [data-label] > .so-tbl-val { flex: 1 1 0; min-width: 0; white-space: normal; }
}

/* ---------- Design plan 1.4: 11px floor for builder labels ---------- */
.so-custom-card__tag, .so-loadup-row__flag { font-size: max(11px, .72rem) !important; }

/* ---------- Design plan 1.9: phone header stack ---------- */
@media (max-width: 600px) {
  .so-topbar .container { justify-content: center; }
  /* body.postid-71611 form: the mattress page sets an 11px floor on this span with !important, which showed both lines */
  .so-topbar-right, body.postid-71611 .so-topbar .so-topbar-right { font-size: 0 !important; line-height: 0; white-space: nowrap; }
  .so-topbar-right::after { content: "Since 2007 \00B7  Google Top Quality Store"; font-size: 12px; line-height: 1.5; }
  .so-ab-email-form { align-items: stretch; display: flex !important; flex-direction: row !important; gap: 6px; }
  .so-ab-email-input { flex: 1 1 auto; min-width: 0; width: auto !important; }
  .so-ab-email-btn { flex: 0 0 auto; padding-left: 14px !important; padding-right: 14px !important; width: auto !important; }
}

/* ---------- Design plan 1.8: phone footer folds ---------- */
@media (max-width: 600px) {
  .so-footer .so-footer-fold-heading { border-top: 1px solid rgba(255,255,255,.14); margin: 0 !important; }
  .so-footer button.so-footer-fold { align-items: center; background: none; border: 0; border-radius: 0; box-shadow: none; color: inherit; cursor: pointer; display: flex; font: inherit; justify-content: space-between; letter-spacing: inherit; margin: 0; min-height: 48px; padding: 4px 0; text-align: left; text-transform: inherit; width: 100%; }
  .so-footer button.so-footer-fold::after { content: "+"; font-family: var(--so-font, Inter, sans-serif); font-size: 1.25rem; font-weight: 400; line-height: 1; opacity: .8; }
  .so-footer button.so-footer-fold[aria-expanded="true"]::after { content: "\2212"; }
  .so-footer button.so-footer-fold:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
  .so-footer .so-footer-fold-heading + ul { margin: 0 0 .5rem; }
  .so-footer .so-footer-fold-heading + ul a { align-items: center; display: flex; min-height: 44px; }
  .so-footer .so-footer-col { margin-bottom: 0 !important; padding-bottom: 0 !important; }
  .so-footer .so-footer-grid { gap: 0 !important; }
  .so-footer .so-footer-col address { margin-top: 1rem; }
}

/* ---------- Design plan 1.10: 11px floor and tap sizes in the menus ---------- */
.so-mega-feature__eyebrow, .so-mega-tag, .so-cart-count { font-size: 11px !important; }
.so-mobile-menu .so-mobile-expand { min-height: 44px; min-width: 44px; }
.so-mobile-menu .so-mobile-sub a { align-items: center; display: flex; min-height: 44px; }
.so-mobile-menu .so-mobile-contact { align-items: center; display: flex; min-height: 44px; }

/* ---------- Design plan 1.7: even builder grids on desktop (the mattress has its own copy of this) ---------- */
@media (min-width: 850px) {
  body:not(.postid-71611) #woomax-builder.wm-v2 .woomax-options:not(.wm-v2-heights):is(:has(> .woomax-option-card:nth-child(7)), :has(> .woomax-option-card:nth-child(4):last-child)) { gap: 14px 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body:not(.postid-71611) #woomax-builder.wm-v2 .woomax-options:not(.wm-v2-heights):is(:has(> .woomax-option-card:nth-child(7)), :has(> .woomax-option-card:nth-child(4):last-child)) .woomax-option-card { padding: 20px 12px 14px; }
  body:not(.postid-71611) #woomax-builder.wm-v2 .woomax-options:not(.wm-v2-heights):is(:has(> .woomax-option-card:nth-child(7)), :has(> .woomax-option-card:nth-child(4):last-child)) .woomax-option-price { font-size: 17px; gap: 2px 6px; margin-top: 10px; }
  body:not(.postid-71611) #woomax-builder.wm-v2 .woomax-options:not(.wm-v2-heights):is(:has(> .woomax-option-card:nth-child(7)), :has(> .woomax-option-card:nth-child(4):last-child)) .wm-v2-long-badge { letter-spacing: .02em; line-height: 1.35; padding: 5px 8px; }
}

/* ---------- Delivery box contrast (rollout report 09, visual notes 6 and 7): hint 3.2:1 and white-on-tan flag 2.7:1 ---------- */
.so-loadup-row__hint { color: #5f6862 !important; }
.so-loadup-row__flag { background: #f3e8cc !important; color: #6b4f1d !important; }

/* ---------- Design plan 1.18: product gallery thumbnails (the mattress has its own copy of this) ---------- */
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0 !important; padding: 0 !important; list-style: none; }
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs li { width: auto !important; float: none !important; margin: 0 !important; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(31, 48, 38, 0); }
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs img { width: 100%; height: 100%; object-fit: cover; opacity: 1 !important; cursor: pointer; }
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs li:has(img.flex-active) { outline: 2px solid var(--so-green-dark, #1f3026); outline-offset: -2px; }
/* Six or seven thumbnails sit in one row, eight in two rows of four, instead of a short second row. */
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs:has(> li:nth-child(7):last-child) { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs:has(> li:nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) {
  /* Phones: thumbnails stay big enough to tap (six as three and three, seven as four and three). */
  body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.single-product:not(.postid-71611) .woocommerce-product-gallery .flex-control-thumbs:has(> li:nth-child(7):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
}

/* 1.20 Chat nudge: tucked away while it would sit over the builder (script so-nudge-tuck). */
#soai-chat-nudge.so-nudge-tucked, #soai-welcome-card.so-nudge-tucked, .soai-bubble.so-nudge-tucked { visibility: hidden !important; pointer-events: none; }
/* 1.20 Phones: room under the footer so the chat launcher does not sit on the legal links. */
@media (max-width: 600px) { footer.so-footer { padding-bottom: 84px; } }

/* Mattress page, phones: the promo bar's email form is swapped for an "Email offers +" button by
   so-mattress-refined.js a few seconds into the load, which made the bar 6px shorter and moved the whole page
   (Lighthouse layout shift 0.126, 2026-11-12). Until that script has run, the form holds the button's place unseen. */
@media (max-width: 767px) {
  body.so-refined.postid-71611:not(.so-refine-offers-ready) .so-ab-email { visibility: hidden; grid-column: 2; grid-row: 2; height: 34px; min-height: 34px; overflow: hidden; padding: 0; margin: 0; }
}

/* Placeholder for the thumbnail strip until the gallery script builds it: same height as the new strip
   (so-thumb-strip variables from so-site-palette.php), so nothing below the gallery moves. */
body.single-product .woocommerce-product-gallery.so-stable-gallery.so-gallery-thumbnails { container-type: inline-size; }
body.single-product .so-stable-gallery.so-gallery-thumbnails:not(:has(.flex-control-thumbs))::after {
  aspect-ratio: auto; margin-top: 10px;
  height: calc(var(--so-tg-r, 1) * ((100cqw - (var(--so-tg-c, 5) - 1) * var(--so-tg-g, 8px)) / var(--so-tg-c, 5) / 1.5) + (var(--so-tg-r, 1) - 1) * var(--so-tg-g, 8px));
}

/* ---------- Contrast and tap size (Lighthouse accessibility audit, 2026-11-12) ---------- */
/* Small grey text that fell just under 4.5:1 on its background; each is the same hue, a step darker or lighter. */
.so-footer-hours { opacity: 1; color: #aab1a8; }
.so-footer-affirm-disclosure p { color: #a9aea7; }
.so-footer address a { display: inline-block; padding: 4px 0; }
.woomax-starting-price .woomax-original-price, .woomax-starting-price .woomax-original-price bdi { color: #657067 !important; }
body #woomax-builder.wm-v2 #woomax-free-pillows .woomax-pillows-value { color: #566158 !important; }
.postid-71611 .so-mx-figcap { color: #5d6a61; }
.postid-71611 .so-mx-eyebrow { color: #7a5c25; }
.postid-71611 .so-mx-side-label { color: #55705a; }
.postid-71611 .so-mx-scale-medium em, .postid-71611 .so-mx-scale-firm em { color: #1f3026; }

/* ---------- Contrast, second pass (Lighthouse accessibility audit, 2026-11-12) ---------- */
/* Same hues, a step darker, so small grey text reaches 4.5:1; links inside a paragraph are underlined so they
   do not rely on colour alone. */
body .woomax-starting-price .woomax-original-price .woocommerce-Price-amount,
body .woomax-starting-price .woomax-original-price .woocommerce-Price-amount bdi { color: #657067 !important; }
body.postid-71611 .so-mx-table-note { color: #5d6a61; }
body.postid-71611 .so-mx-faq-list .so-faq-group-toggle span { color: #55705a; }
body.postid-71611 .so-mx-faq-list .so-faq-group-toggle em { color: #5d6a61; }
body.home .so-trust-strip .so-trust-inner span { color: #667068; }
body.home .so-financing .so-financing-inner p[style*="so-text-light"] { color: #667068 !important; }
body.home .so-about p a, body.home .so-section-header .so-body-text a { text-decoration: underline; text-underline-offset: 2px; }
/* The crossed-out price was also faded to 60%, which washed the grey out to 2.4:1; the colour alone carries it now. */
body .woomax-starting-price .woomax-original-price { opacity: 1 !important; }

/* Keep room for the scrollbar from the first paint. On screens with a classic scrollbar (Windows, and Lighthouse's
   desktop run) the page first paints before it is tall enough to scroll; when the scrollbar then appears the whole
   centred layout moves 7px, which measured as a 0.105 layout shift on the sheets page. */
html { scrollbar-gutter: stable; }

/* Accessibility pass (seo review 2026-11-14, F9): small muted text that measured under 4.5:1, and links inside
   running text that were told apart from it by colour alone. Colours keep their hue, one or two steps darker. */
.so-custom-card__unit, .so-custom-card__note, .so-custom-card span:not([class]), #woomax-pillow-value { color: #636363 !important; }
.so-loadup-row__excludes { color: #75684f !important; }
.so-loadup-row__modnote { color: #666 !important; }
.postid-71478 .so-tp-eyebrow, .postid-71478 .so-tp-faq-list .so-faq-group-title, .postid-71611 .so-mx-faq-list .so-faq-group-title, .postid-71478 .so-tp-certs strong { color: #4f6a52 !important; }
.postid-71478 .so-tp-table-note { color: #55635a !important; }
.postid-71478 { --tp-xfirm: #8a6e3c; }
.postid-71478 .so-tp-scale em, .postid-71611 .so-mx-scale em { color: #3d4640; }
.postid-71478 .so-tp-scale-xfirm em { color: #fff; }
.single-product .entry-content p a:not(.button):not([class*="btn"]), .single-product .entry-content li a:not(.button):not([class*="btn"]),
.single-product .so-faq-a a { text-decoration: underline; text-underline-offset: 2px; }
/* The Affirm "Learn more" link sits inside a sentence and is injected by Affirm without an underline. */
a.affirm-modal-trigger { text-decoration: underline; text-underline-offset: 2px; }
/* Desktop header: with a long sale name the last menu link ran under the search icon (overlapping click targets). */
@media (min-width: 1025px) and (max-width: 1480px) { .so-header .so-nav-link { padding-left: .6rem; padding-right: .6rem; } }
@media (min-width: 1025px) and (max-width: 1280px) { .so-header .so-nav-link { padding-left: .4rem; padding-right: .4rem; } }
