/* ==========================================================================
   BESPOKE SPORT · Master / global page theme
   --------------------------------------------------------------------------
   Applies the dark mint look-and-feel to EVERY front-end page by default,
   so a brand-new Page created in WP Admin picks up the brand colours,
   typography and link styling automatically — no per-page setup needed.

   Targets every page via `body.bespoke-themed` (added in customiser-master.php).
   Specific page CSS (shop / blog / cart / contact / PDP) layers on top.

   Opt out on a specific page by adding `bs-light` to the page's body class
   (Astra has a body-class field per page) OR by returning false from the
   `bespoke_apply_master_theme` PHP filter.

   What this DOES NOT touch on purpose:
     - Elementor section backgrounds (each section keeps the BG you set in
       Elementor — for sections that should inherit the dark canvas, set
       their background to transparent in Elementor editor).
     - Elementor widget defaults (heading colours, button colours).
     - The customiser configurator UI inside the PDP (its own design).

   Pairs with the Claude Design palette already used by:
     bespoke-shop-page.css · bespoke-blog-page.css · bespoke-cart-page.css
     bespoke-contact-page.css · bespoke-product-page.css

   Heavy !important usage is intentional — Astra and Elementor ship
   high-specificity defaults that otherwise win.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. DESIGN TOKENS — kept in sync with every other bespoke-*.css.
   -------------------------------------------------------------------------- */
:root {
  --bs-ink:          #0E0E10;
  --bs-deep:         #050505;
  --bs-panel:        #141417;
  --bs-panel-2:      #1A1A1E;
  --bs-mint:         #7FECB8;
  --bs-mint-deep:    #3DA67A;
  --bs-mint-soft:    rgba(127,236,184,0.10);
  --bs-cream:        #F2EFE9;
  --bs-text:         rgba(255,255,255,0.85);
  --bs-muted:        rgba(255,255,255,0.55);
  --bs-faint:        rgba(255,255,255,0.40);
  --bs-line:         rgba(255,255,255,0.10);
  --bs-font-ui:      'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --bs-font-mono:    'JetBrains Mono', SFMono-Regular, ui-monospace, monospace;
  --bs-font-display: 'Anton', Impact, 'Arial Black', sans-serif;
}


/* --------------------------------------------------------------------------
   2. CANVAS — dark page background + brand fonts on EVERY page.
   --------------------------------------------------------------------------
   `.bs-light` is the escape hatch — add it to a specific page's body
   classes and that page reverts to the theme's default (light) canvas
   without touching the rest of the site.
   -------------------------------------------------------------------------- */
body.bespoke-themed:not(.bs-light) {
  background-color: var(--bs-ink) !important;
  color: var(--bs-text) !important;
  font-family: var(--bs-font-ui) !important;
}

/* Common page-shell wrappers Astra + Elementor emit. Force transparent
   so the dark body background shows through and we don't get a white
   inner column on every page. The screenshot of the homepage showed
   thick white side-strips: those came from Astra's #page / .ast-container
   / .entry-content wrappers (which default to white-ish on the
   page-builder template) — they're all on the list now. */
body.bespoke-themed:not(.bs-light) #page,
body.bespoke-themed:not(.bs-light) .site,
body.bespoke-themed:not(.bs-light) .site-content,
body.bespoke-themed:not(.bs-light) #content,
body.bespoke-themed:not(.bs-light) #primary,
body.bespoke-themed:not(.bs-light) #main,
body.bespoke-themed:not(.bs-light) .content-area,
body.bespoke-themed:not(.bs-light) .ast-container,
body.bespoke-themed:not(.bs-light) .ast-woocommerce-container,
body.bespoke-themed:not(.bs-light) article.page,
body.bespoke-themed:not(.bs-light) article.post,
body.bespoke-themed:not(.bs-light) .ast-article-post,
body.bespoke-themed:not(.bs-light) .ast-article-single,
body.bespoke-themed:not(.bs-light) .entry-content,
body.bespoke-themed:not(.bs-light) .elementor,
body.bespoke-themed:not(.bs-light) [data-elementor-type] {
  background-color: transparent !important;
  box-shadow: none !important;
}


/* --------------------------------------------------------------------------
   3. DEFAULT TYPOGRAPHY — force white headings + body copy everywhere
   on the dark canvas. Originally these rules excluded Elementor's own
   widgets to avoid stomping on editor-configured colours; in practice
   the editor-configured colours are almost always cream / dark on a
   light theme that no longer exists, so the headings on Gallery /
   Locker Room / Contact were rendering invisible (cream on dark).

   We now force every heading to white. If a SPECIFIC heading needs a
   different colour (e.g. the mint "YOUR" span inside the homepage
   hero), apply that colour to the inner span or override per-element
   in Elementor — span colour beats heading colour on specificity.
   -------------------------------------------------------------------------- */
body.bespoke-themed:not(.bs-light) h1,
body.bespoke-themed:not(.bs-light) h2,
body.bespoke-themed:not(.bs-light) h3,
body.bespoke-themed:not(.bs-light) h4,
body.bespoke-themed:not(.bs-light) h5,
body.bespoke-themed:not(.bs-light) h6,
body.bespoke-themed:not(.bs-light) .elementor-heading-title,
body.bespoke-themed:not(.bs-light) .elementor-widget-heading .elementor-heading-title {
  color: #fff !important;
}

body.bespoke-themed:not(.bs-light) p,
body.bespoke-themed:not(.bs-light) .elementor-widget-text-editor,
body.bespoke-themed:not(.bs-light) .elementor-widget-text-editor p,
body.bespoke-themed:not(.bs-light) .elementor-widget-text-editor li {
  color: var(--bs-text) !important;
}


/* --------------------------------------------------------------------------
   4. LINKS — mint by default, white on hover. Scoped to non-Elementor
   anchors so existing Elementor button widgets keep their own colour.
   -------------------------------------------------------------------------- */
body.bespoke-themed:not(.bs-light) a:not([class*="elementor-"]):not(.button):not(.add_to_cart_button):not(.checkout-button):not(.bs-world-btn):not(.bs-how__cta) {
  color: var(--bs-mint);
  transition: color 0.2s ease;
}
body.bespoke-themed:not(.bs-light) a:not([class*="elementor-"]):not(.button):not(.add_to_cart_button):not(.checkout-button):not(.bs-world-btn):not(.bs-how__cta):hover {
  color: #fff;
}


/* --------------------------------------------------------------------------
   5. SELECTION — mint highlight so highlighted text reads as on-brand.
   -------------------------------------------------------------------------- */
body.bespoke-themed:not(.bs-light) ::selection {
  background: var(--bs-mint);
  color: var(--bs-ink);
}


/* --------------------------------------------------------------------------
   6. SCROLLBAR — dark with mint thumb (Chromium / Firefox).
   -------------------------------------------------------------------------- */
body.bespoke-themed:not(.bs-light) {
  scrollbar-color: var(--bs-mint-deep) var(--bs-deep);
  scrollbar-width: thin;
}
body.bespoke-themed:not(.bs-light) ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
body.bespoke-themed:not(.bs-light) ::-webkit-scrollbar-track {
  background: var(--bs-deep);
}
body.bespoke-themed:not(.bs-light) ::-webkit-scrollbar-thumb {
  background: var(--bs-mint-deep);
  border-radius: 999px;
  border: 2px solid var(--bs-deep);
}
body.bespoke-themed:not(.bs-light) ::-webkit-scrollbar-thumb:hover {
  background: var(--bs-mint);
}


/* --------------------------------------------------------------------------
   7. BUTTONS — give any plain WP/WC button a brand pill look IF the
   page hasn't already styled it. Excludes Elementor widget buttons
   (those keep whatever the editor specifies).
   -------------------------------------------------------------------------- */
body.bespoke-themed:not(.bs-light) input[type="submit"]:not([class*="elementor-"]):not(.wpforms-submit),
body.bespoke-themed:not(.bs-light) button[type="submit"]:not([class*="elementor-"]):not(.wpforms-submit) {
  background: var(--bs-mint);
  color: var(--bs-ink);
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-family: var(--bs-font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s ease;
}
body.bespoke-themed:not(.bs-light) input[type="submit"]:not([class*="elementor-"]):not(.wpforms-submit):hover,
body.bespoke-themed:not(.bs-light) button[type="submit"]:not([class*="elementor-"]):not(.wpforms-submit):hover {
  filter: brightness(1.08);
}


/* --------------------------------------------------------------------------
   8. `.bs-dark` UTILITY CLASS — drop on any Elementor section, column,
   container, or block to force the BEspoke dark canvas + white text on
   that one element. Useful for any old light Elementor section you
   want to flip dark without rebuilding it.

   How to use:
     In Elementor, click the section / column / widget you want dark →
     Advanced ▸ CSS Classes → enter:  bs-dark
     Save. The section turns dark immediately.

   What it does:
     * forces the background dark ink
     * forces every heading inside white
     * forces body text and Elementor text-editor copy to white
     * forces icon-box titles white, descriptions muted-white
     * keeps the BEspoke mint hover on internal links

   Mirror utility `.bs-light` is left undefined on purpose — that
   lets it act as the master theme's opt-out class (see Section 2)
   AND as a hint to Elementor section settings (a section that
   genuinely needs a light look should use Elementor's own
   background controls, not this class).
   -------------------------------------------------------------------------- */
.bs-dark,
.bs-dark.elementor-section,
.bs-dark.elementor-element,
.bs-dark.elementor-column,
.bs-dark.e-con,
.bs-dark.e-con-inner,
section.bs-dark,
div.bs-dark {
  background-color: var(--bs-ink) !important;
  background-image: none !important;
  color: var(--bs-text) !important;
}

/* Headings inside a .bs-dark section turn pure white */
.bs-dark .elementor-heading-title,
.bs-dark h1, .bs-dark h2, .bs-dark h3,
.bs-dark h4, .bs-dark h5, .bs-dark h6 {
  color: #fff !important;
}

/* Body copy + Elementor text-editor widgets */
.bs-dark p,
.bs-dark .elementor-widget-text-editor,
.bs-dark .elementor-widget-text-editor p,
.bs-dark .elementor-widget-text-editor li {
  color: var(--bs-text) !important;
}

/* Elementor icon-box / image-box widgets */
.bs-dark .elementor-icon-box-title,
.bs-dark .elementor-icon-box-title a,
.bs-dark .elementor-image-box-title,
.bs-dark .elementor-image-box-title a {
  color: #fff !important;
}
.bs-dark .elementor-icon-box-description,
.bs-dark .elementor-image-box-description {
  color: var(--bs-muted) !important;
}


/* --------------------------------------------------------------------------
   9. Page-specific Elementor element overrides — targeted dark fixes
   for sections that the editor configured with explicit light
   backgrounds before the dark theme arrived. Each rule keys off the
   auto-generated Elementor element ID seen on the live HTML.

   If any section is rebuilt and the ID changes, add `bs-dark` to its
   CSS classes (see #8 above) and these specific rules become
   redundant.
   -------------------------------------------------------------------------- */

/* Homepage "Why Choose Bespoke?" — outer + inner sections */
body.bespoke-themed .elementor-element-084080c,
body.bespoke-themed .elementor-element-f161f5c,
body.bespoke-themed .elementor-element-a87b402,
body.bespoke-themed .elementor-element-9d00b78,
body.bespoke-themed .elementor-element-0b59807 {
  background-color: var(--bs-ink) !important;
  background-image: none !important;
}

/* Contact page — WPForms widget + its parent column / container */
body.bespoke-themed .elementor-element-5545211,
body.bespoke-themed .elementor-element-5545211 .elementor-widget-container {
  background-color: transparent !important;
  background-image: none !important;
}

/* Catch-all: any Elementor section / column on a contact page that has
   an INLINE white-ish background colour the editor baked in. Scoped
   under body.bespoke-contact-styled so it can't bleed into other pages
   that legitimately want a light section. */
body.bespoke-contact-styled .elementor-section,
body.bespoke-contact-styled .elementor-column,
body.bespoke-contact-styled .e-con,
body.bespoke-contact-styled .e-con-inner,
body.bespoke-contact-styled .elementor-widget-wrap {
  background-color: transparent !important;
}


/* --------------------------------------------------------------------------
   Checkout · PLACE ORDER button
   The theme leaves it near-black on the dark checkout, so it reads as
   disabled until hovered. Make it solid brand mint by default — it's the
   single most important button on the site. (Lives here, not in
   bespoke-cart-page.css, because that file only loads on /cart/.)
   -------------------------------------------------------------------------- */
body.woocommerce-checkout #place_order,
body.woocommerce-checkout button#place_order.button.alt {
  background: #5DCAA5 !important;
  color: #0D0D0D !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  padding: 18px 24px !important;
  transition: filter .15s ease, transform .1s ease !important;
}
body.woocommerce-checkout #place_order:hover,
body.woocommerce-checkout #place_order:focus {
  background: #5DCAA5 !important;
  color: #0D0D0D !important;
  filter: brightness(1.08) !important;
}
body.woocommerce-checkout #place_order:active {
  transform: translateY(1px) !important;
}

/* --------------------------------------------------------------------------
   Checkout · the payment box
   WooCommerce draws the chosen payment method's box light grey, and the
   dark theme's white text all but vanished on it (Nick, 17 Oct 2026).
   Everything written in the box is dark ink instead — the test-mode note,
   "save payment information", each gateway's description. The card
   fields themselves are WooPayments', drawn in Stripe's own frame where no
   stylesheet reaches: see bespoke_checkout_card_fields_ink() in
   customiser-master.php for their labels.
   -------------------------------------------------------------------------- */
body.woocommerce-checkout #payment div.payment_box,
body.woocommerce-checkout #payment div.payment_box *:not(button):not(.button) {
  color: #0D0D0D !important;
}
body.woocommerce-checkout #payment div.payment_box a:not(.button) {
  color: #0D0D0D !important;
  text-decoration: underline !important;
}

/* --------------------------------------------------------------------------
   Checkout · YOUR ORDER review panel
   The review table sat transparent over a light page-section background —
   white text on pale grey, barely readable. Give the panel its own solid
   dark card (mirroring the cart's Basket Totals card): light header strip
   with dark text, white rows on #141417, meta as a label/value grid, and
   the final total in brand mint. Verified live on staging 18 Jul 2026.
   (Lives here because bespoke-cart-page.css only loads on /cart/.)
   -------------------------------------------------------------------------- */
body.woocommerce-checkout #order_review_heading,
body.woocommerce-checkout #order_review {
  background: #141417 !important;
  border: none !important;
}
body.woocommerce-checkout #order_review_heading {
  border-radius: 16px 16px 0 0 !important;
  padding: 20px 22px 4px !important;
  margin-bottom: 0 !important;
  color: #fff !important;
}
body.woocommerce-checkout #order_review {
  border-radius: 0 0 16px 16px !important;
  padding: 10px 22px 22px !important;
}
/* Header strip: light banner + dark text, same treatment as the cart */
body.woocommerce-checkout .woocommerce-checkout-review-order-table thead th {
  background: #fbfbfb !important;
  color: #141417 !important;
  font-size: 11px !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  padding: 10px 12px !important;
  white-space: nowrap !important;
}
/* Body rows: white text, subtle dividers, top-aligned */
body.woocommerce-checkout .woocommerce-checkout-review-order-table td,
body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th {
  color: #fff !important;
  border-color: #2A2A2A !important;
  padding: 12px 10px !important;
  vertical-align: top !important;
  background: transparent !important;
}
/* Item meta: label/value grid, values wrap freely, nothing clips */
body.woocommerce-checkout .woocommerce-checkout-review-order-table dl.variation {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  column-gap: 8px !important;
  row-gap: 2px !important;
  margin: 6px 0 0 !important;
  max-width: none !important;
}
body.woocommerce-checkout .woocommerce-checkout-review-order-table dl.variation dt {
  float: none !important; width: auto !important; margin: 0 !important;
  white-space: nowrap !important; color: #888 !important; font-weight: 500 !important;
}
body.woocommerce-checkout .woocommerce-checkout-review-order-table dl.variation dd {
  margin: 0 !important; overflow: visible !important;
  min-width: 0 !important; font-weight: 600 !important;
}
/* Totals: amounts never break; the final total pops in brand mint */
body.woocommerce-checkout .woocommerce-checkout-review-order-table .amount { white-space: nowrap !important; }
body.woocommerce-checkout .woocommerce-checkout-review-order-table .order-total .amount {
  color: #5DCAA5 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
}

/* --------------------------------------------------------------------------
   Mobile · page-aware compact site header
   The Elementor header template renders ~120px tall on phones with a large
   centred logo. Two tiers (designer call, 18 Jul 2026):

   · BRAND pages (home, blog, contact, gallery …): keep the logo readable —
     64px cap, header lands ≈ 84px. Still a third slimmer than stock.
   · COMMERCE funnel (shop archive, product pages, cart, checkout): space
     is precious — 40px logo, header ≈ 56px, barely thicker than the burger.

   The stacked BE: mark is portrait, so it shrinks fast; if a horizontal
   mobile lockup is designed later, add it in the Elementor header as a
   second image widget (visible mobile-only, original desktop-only) and
   these same caps apply to whichever is shown. Desktop header untouched.
   Verified at a real 390px viewport (iframe).
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  /* Structural collapse — both tiers. The template's padding/min-heights
     are what inflated the bar to 120px. */
  header.elementor-location-header .elementor-section,
  header.elementor-location-header .elementor-container,
  header.elementor-location-header .elementor-column,
  header.elementor-location-header .elementor-widget-wrap {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  header.elementor-location-header .elementor-widget { margin: 0 !important; }
  header.elementor-location-header { padding: 8px 0 !important; }

  /* Tier 1 · default (brand pages): readable logo. max-width:none is
     load-bearing — the Elementor image widget ships max-width:60%, which
     silently throttles the height cap (the stacked mark rendered 38px
     tall despite a 64px allowance). */
  header.elementor-location-header img {
    max-height: 64px !important;
    max-width: none !important;
    height: auto !important;
    width: auto !important;
  }

  /* Tier 2 · commerce funnel: tight bar */
  body.post-type-archive-product header.elementor-location-header img,
  body.woocommerce-shop         header.elementor-location-header img,
  body.tax-product_cat          header.elementor-location-header img,
  body.single-product           header.elementor-location-header img,
  body.woocommerce-cart         header.elementor-location-header img,
  body.woocommerce-checkout     header.elementor-location-header img {
    max-height: 40px !important;
  }
  body.post-type-archive-product header.elementor-location-header,
  body.woocommerce-shop         header.elementor-location-header,
  body.tax-product_cat          header.elementor-location-header,
  body.single-product           header.elementor-location-header,
  body.woocommerce-cart         header.elementor-location-header,
  body.woocommerce-checkout     header.elementor-location-header {
    padding: 6px 0 !important;
  }
}


/* --------------------------------------------------------------------------
   Header cart button (injected into the Elementor header by
   customiser-master.php). Sits top-right beside the search icon on desktop
   and mobile; mint count bubble; hidden bubble when the basket is empty.
   -------------------------------------------------------------------------- */
.bcp-header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 14px;
  color: #F5F5F0;
  text-decoration: none;
  transition: color .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.bcp-header-cart:hover,
.bcp-header-cart:focus { color: #5DCAA5; }
.bcp-header-cart:active { transform: translateY(1px); }
.bcp-header-cart svg { display: block; }
.bcp-header-cart .bcp-cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: #5DCAA5;
  color: #0D0D0D;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
}
.bcp-header-cart .bcp-cart-count[hidden],
.bcp-header-cart .bcp-cart-count[data-count="0"] { display: none; }
/* On the tight commerce-funnel mobile header, match the smaller scale. */
@media (max-width: 980px) {
  .bcp-header-cart { width: 36px; height: 36px; margin: 0 10px; }
  .bcp-header-cart svg { width: 20px; height: 20px; }
}
/* The header's right-hand column is set narrow in Elementor (about 45px on
   phones and tablets), too small for the basket plus the search icon, so the
   search icon poked past the screen edge and pages scrolled sideways (~10px on
   phones, ~25px at tablet width). That column now takes the width its icons
   need, and the menu column gives up the space. */
header.elementor-location-header .elementor-container:has(> .elementor-column > .bcp-header-cart) {
  flex-wrap: nowrap !important;
}
header.elementor-location-header .elementor-column:has(> .bcp-header-cart) {
  flex: 0 0 auto !important;
  width: auto !important;
}
header.elementor-location-header .elementor-column:has(> .bcp-header-cart) > .elementor-widget-wrap {
  flex: 0 0 auto;
  width: auto !important;
}
header.elementor-location-header .elementor-container:has(> .elementor-column > .bcp-header-cart) > .elementor-column:has(.elementor-widget-nav-menu) {
  flex: 1 1 0% !important;
  width: auto !important;
  min-width: 0;
}
.bcp-header-cart { flex-shrink: 0; }


/* ==========================================================================
   END · Bespoke Sport master / global page theme
   ========================================================================== */
