/*
Theme Name: Flag Swag Child
Theme URI: https://flagswag.ca
Description: Child theme for Flag Swag — safe customization layer. All overrides go here.
Author: Dominion Flag Swag Incorporated
Author URI: https://flagswag.ca
Template: flagswag
Version: 1.0.17
License: Proprietary
Text Domain: flagswag-child
*/

/* ================================================================
   CHILD THEME OVERRIDES — v1.0.7
   ================================================================ */

/* ── 1. Header positioning — WP Admin bar ─────────────────────────
   WordPress adds margin-top: 32px to <html> when the admin bar is
   visible. The fixed header is positioned relative to the viewport
   so it overlaps the admin bar. These rules push it down correctly.
   ──────────────────────────────────────────────────────────────── */
.admin-bar .site-header {
  top: calc(32px + var(--banner-h, 0px));
}
@media screen and (max-width: 782px) {
  /* WP admin bar is 46px tall on mobile */
  .admin-bar .site-header {
    top: calc(46px + var(--banner-h, 0px));
  }
}

/* ── 2. Header positioning — announcement bar ─────────────────────
   child.js measures the real rendered height of the announcement bar
   and writes it to --banner-h on <html>. The parent header rule
   `top: var(--banner-h, 0px)` already reads this variable.
   This transition ensures the header glides smoothly when the bar
   is dismissed rather than snapping.
   ──────────────────────────────────────────────────────────────── */
.site-header {
  transition:
    top              var(--t-mid) var(--ease),
    background       var(--t-mid) var(--ease),
    border-color     var(--t-mid) var(--ease),
    backdrop-filter  var(--t-mid) var(--ease);
}

/* ── 3. Footer logo — "Flag Swag" text forced white ───────────────
   The parent CSS sets .site-logo__text .logo-swag { color: var(--c-blue) }
   which overrides the inline color:var(--c-white) on the footer logo
   wrapper. Scoping to .site-footer ensures the header logo is untouched.
   ──────────────────────────────────────────────────────────────── */
.site-footer .site-logo__text .logo-swag,
.site-footer .site-logo__text .logo-flag {
  color: var(--c-white) !important;
}
/* Keep "Dominion" in the lighter red so it still pops */
.site-footer .site-logo__text .logo-flag {
  color: var(--c-red-light) !important;
}

/* ── 4. Shop-by-category card — title turns red on hover ──────────
   Cards are <a class="card"> elements; the h4 inside is green by default.
   ──────────────────────────────────────────────────────────────── */
.card:hover h3,
.card:hover h4,
.card:hover h5 {
  color: var(--c-red);
  transition: color var(--t-fast) var(--ease);
}

/* ── 5. Newsletter — wider email input, narrower button ───────────
   Raises flex-basis so the input claims the majority of row space.
   Button padding trimmed so it doesn't crowd the input at mid widths.
   ──────────────────────────────────────────────────────────────── */


/* ── 6. Flagswag Swatches plugin — design system integration ──────
   These rules style the custom swatch output from the
   flagswag-swatches plugin to match the theme design system.
   ──────────────────────────────────────────────────────────────── */

/* Swatch row container */
.fgs-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-sm) 0 var(--space-md);
}

/* Base swatch */
.fgs-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow   var(--t-fast) var(--ease),
    transform    var(--t-fast) var(--ease);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.fgs-swatch:hover {
  border-color: var(--c-red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.fgs-swatch.selected {
  border-color: var(--c-red) !important;
  box-shadow: 0 0 0 2px var(--c-red-muted), var(--shadow-sm);
}
.fgs-swatch.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.fgs-swatch.disabled::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: linear-gradient(
    135deg,
    transparent 45%,
    var(--c-text3) 45%,
    var(--c-text3) 55%,
    transparent 55%
  );
  border-radius: 1px;
}

/* Color swatch — round circle */
.fgs-swatch--color {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
}
.fgs-swatch--color .fgs-swatch__color {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
/* Bi-color (two-tone) swatch */
.fgs-swatch--color .fgs-swatch__bicolor {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fgs-c1, #ccc) 50%, var(--fgs-c2, #999) 50%);
}

/* Label swatch — pill shape */
.fgs-swatch--label {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text);
  background: var(--c-surface);
  letter-spacing: 0.02em;
}
.fgs-swatch--label.selected {
  background: var(--c-red-muted);
  color: var(--c-red);
}

/* Tooltip */
.fgs-swatch[title]:hover::before {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-text);
  color: var(--c-white);
  font-size: 0.72rem;
  font-family: var(--font-body);
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  pointer-events: none;
  z-index: 100;
}
.fgs-swatch[title]:hover::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--c-text);
  pointer-events: none;
  z-index: 100;
}

/* Dark mode swatch adjustments */
[data-theme="dark"] .fgs-swatch--label {
  background: var(--c-surface2);
  color: var(--c-text);
}
[data-theme="dark"] .fgs-swatch--label.selected {
  background: var(--c-red-muted);
  color: var(--c-red-light);
}

/* Clear selection link */
.fgs-clear-swatch {
  font-size: 0.78rem;
  color: var(--c-text3);
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
  margin-top: var(--space-xs);
}
.fgs-clear-swatch:hover {
  color: var(--c-red);
}

/* Hide the native WC select when swatches are rendered */
.fgs-has-swatches select.fgs-hidden-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* Admin — swatch manager page */
.fgs-admin-wrap .fgs-color-preview {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ccc;
  vertical-align: middle;
  margin-right: 6px;
}

/* ================================================================
   CHILD OVERRIDES — v1.0.8
   ================================================================ */

/* ── 1. "View All Products" button — white text ────────────────────
   A stray `.btn--primary:hover { color:#000 }` in the parent
   overrides the base white. Restore it with higher specificity.
   ──────────────────────────────────────────────────────────────── */
.mega-menu .btn--primary,
.mega-menu .btn--primary:hover,
.mega-menu .btn--primary:focus {
  color: #fff !important;
}

/* ── 2. Shop search — move icon to right, don't cover text ─────────
   Parent puts icon at left:20px and adds padding-left:52px.
   We flip the icon to the right side so it never overlaps text.
   ──────────────────────────────────────────────────────────────── */
.shop-search__input {
  padding-left: 20px !important;
  padding-right: 52px !important;
}
.shop-search__icon {
  left:  auto !important;
  right: 16px !important;
}

/* ── 3. Shop page — 4 products per row, wider usable area ──────────
   Shrink the filter sidebar slightly so the product area gains width.
   The product grid uses repeat(4,1fr) at full width, stepping down
   gracefully on smaller screens.  We keep horizontal margin so
   vertical ad banners have room on each side.
   ──────────────────────────────────────────────────────────────── */
.woocommerce-page .container,
.woocommerce-shop  .container {
  max-width: 1420px;
}

/* Sidebar narrower → product area wider */
.shop-layout {
  grid-template-columns: 220px 1fr !important;
  gap: var(--space-lg) !important;
}

/* Force 4-column product grid (WC filter also set in woocommerce.php) */
.woocommerce ul.products {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--space-md) !important;
}

/* Step down gracefully */
@media (max-width: 1100px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (max-width: 780px) {
  .shop-layout {
    grid-template-columns: 1fr !important;
  }
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .woocommerce ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* ── 4. Pagination — horizontal across entire theme ────────────────
   WordPress `the_posts_pagination()` outputs:
     <nav class="navigation pagination">
       <div class="nav-links"> <a>1</a> <a>2</a> … </div>
     </nav>
   The nav-links div is block by default, stacking items vertically.
   ──────────────────────────────────────────────────────────────── */
.navigation.pagination,
.navigation.posts-navigation,
.navigation.post-navigation {
  display: flex;
  justify-content: center;
  margin-top: var(--space-3xl);
}
.navigation.pagination .nav-links,
.navigation.posts-navigation .nav-links,
.navigation.post-navigation .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.navigation.pagination .page-numbers,
.nav-links .page-numbers,
.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t-fast);
}
.navigation.pagination .page-numbers:hover,
.nav-links a:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-red-muted);
}
.nav-links .page-numbers.current,
.nav-links span.current {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-red-muted);
  pointer-events: none;
}
.nav-links .prev,
.nav-links .next {
  font-weight: 600;
  padding: 0 14px;
}

/* ── 5. YITH swatch CSS — remove rules that affect native WC selects ─
   The parent theme contains YITH compatibility CSS including
   `.select_option_label { display:inline-flex !important }` which
   is a class WooCommerce also adds to native <option> labels,
   causing them to render as pill swatches when YITH is not active.
   We reset it to the browser default for non-YITH contexts.
   ──────────────────────────────────────────────────────────────── */
/* Only apply YITH swatch styling when YITH has confirmed it's active */
.select_option_label {
  display: revert !important;
}
/* Still style them when YITH wraps them correctly */
.yith_wccl_container .select_option_label,
.ywccl-wrapper .select_option_label {
  display: inline-flex !important;
}

/* ── Newsletter — single definitive override ──────────────────────
   Wins against all parent rules via specificity + !important.
   Input: takes all available flex space, never clips content.
   Button: sized to its text only, never bleeds outside container.
   ──────────────────────────────────────────────────────────────── */
.newsletter-section .newsletter-form,
section.newsletter-section .newsletter-form {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  align-items: stretch !important;
  width: 100% !important;
  overflow: visible !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.newsletter-section .newsletter-form input[type="email"],
section.newsletter-section .newsletter-form input[type="email"] {
  /* flex: 1 1 0% means "take all remaining space, start from 0px" */
  flex: 1 1 0% !important;
  min-width: 0 !important;       /* lets the input shrink below its content width */
  width: 0 !important;           /* overrides any width the parent sets */
  max-width: 100% !important;
  padding: 14px 18px !important;
  font-size: 0.95rem !important;
  box-sizing: border-box !important;
}
.newsletter-section .newsletter-form .btn,
section.newsletter-section .newsletter-form .btn {
  flex: 0 0 auto !important;     /* shrinks to text width, never grows */
  width: auto !important;
  min-width: unset !important;
  max-width: none !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
  white-space: nowrap !important;
  font-size: 0.875rem !important;
  box-sizing: border-box !important;
}
@media (max-width: 480px) {
  .newsletter-section .newsletter-form,
  section.newsletter-section .newsletter-form {
    flex-wrap: wrap !important;
  }
  .newsletter-section .newsletter-form input[type="email"],
  .newsletter-section .newsletter-form .btn {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* ================================================================
   MY ACCOUNT — MODERN ARCHIVIST LAYOUT  (v1.0.9)
   ================================================================ */

/* ── Load Material Symbols for sidebar icons ──────────────────── */
/* (font enqueued via child functions.php on is_account_page()) */

/* ── Hide the standard "My account" page H1 title ─────────────── */
.woocommerce-account .entry-title,
.woocommerce-account h1.page-title,
.woocommerce-account section > .container > .reveal > h1 {
  display: none !important;
}

/* ── Suppress the default section bg that page.php adds ─────── */
.woocommerce-account #main-content > section:first-of-type {
  display: none !important;
}

/* ── Full-bleed account wrapper — bust out of container ────────── */
.woocommerce-account #main-content {
  padding-top: calc(var(--header-h) + var(--banner-h, 0px)) !important;
  padding-bottom: 0 !important;
}
/* Make the WooCommerce shortcode wrapper full width */
.woocommerce-account .woocommerce {
  max-width: 100% !important;
  width: 100% !important;
}
/* Remove container constraints only inside the page content area, not the header */
.woocommerce-account #main-content .container,
.woocommerce-account #main-content .container--narrow {
  max-width: 100% !important;
  padding-inline: 0 !important;
}

/* ── Account page two-column layout ─────────────────────────────
   The my-account.php template wraps nav + content in .fgs-account-inner
   ─────────────────────────────────────────────────────────────── */
.fgs-account-inner {
  display: flex;
  min-height: calc(100vh - var(--header-h) - var(--banner-h, 0px));
  align-items: stretch;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.fgs-account-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #f8f8f6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--header-h) + var(--banner-h, 0px));
  height: calc(100vh - var(--header-h) - var(--banner-h, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  /* Tonal separator — no border per DESIGN.md */
  background: #f3f3f1;
}

/* ── Sidebar brand mark ──────────────────────────────────────── */
.fgs-sidebar__brand {
  padding: 2rem 1.5rem 1.25rem;
  flex-shrink: 0;
}
.fgs-sidebar__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  margin-bottom: 3px;
}
.fgs-sidebar__logo-primary  { color: #930000; }
.fgs-sidebar__logo-secondary { color: #1b1b1b; }
.fgs-sidebar__tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-top: 2px;
}

/* ── Sidebar nav ──────────────────────────────────────────────── */
.fgs-sidebar__nav {
  flex: 1;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
}
.fgs-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem 0.7rem 1.5rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #5d5d5d;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  position: relative;
  border-radius: 0;
  white-space: nowrap;
}
.fgs-sidebar__link:hover {
  color: #1b1b1b;
  background: rgba(0,0,0,0.04);
}
.fgs-sidebar__link--active {
  color: #930000 !important;
  font-weight: 600;
  background: rgba(147,0,0,0.06);
}
/* Active indicator bar on the right edge */
.fgs-sidebar__active-bar {
  position: absolute;
  right: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: #930000;
}
.fgs-sidebar__icon {
  font-size: 1.1rem !important;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  /* Material Symbols — outlined, weight 300 for editorial feel */
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
.fgs-sidebar__link--active .fgs-sidebar__icon {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ── Sidebar footer (logout) ──────────────────────────────────── */
.fgs-sidebar__footer {
  flex-shrink: 0;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: auto;
}
.fgs-sidebar__link--logout {
  color: #9a9a9a !important;
}
.fgs-sidebar__link--logout:hover {
  color: #930000 !important;
  background: rgba(147,0,0,0.05);
}

/* ── Main content area ────────────────────────────────────────── */
.woocommerce-MyAccount-content.fgs-account-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
  background: #f9f9f9;
  /* Override WC default styling */
  border: none !important;
  padding-top: 2.5rem !important;
}

/* ── Suppress default WC nav (pills/tabs) — we have the sidebar ─ */
.woocommerce-MyAccount-navigation {
  display: none !important;
}

/* ── Dashboard content max-width within the main area ─────────── */
.ma-dashboard {
  max-width: 1360px !important;
}

/* ── Mobile: stack sidebar above content ──────────────────────── */
@media (max-width: 900px) {
  .fgs-account-inner {
    flex-direction: column;
  }

  /* Sidebar collapses to a horizontal scrollable pill-nav */
  .fgs-account-sidebar {
    width: 100%;
    height: auto;
    min-height: unset;
    max-height: unset;
    position: static;
    overflow-x: auto;
    overflow-y: hidden;
    display: block;
  }

  /* Hide the lions image on mobile — takes too much vertical space */
  .fgs-sidebar__heraldry,
  .fgs-sidebar__brand { display: none; }

  /* Nav becomes a horizontal scrollable row */
  .fgs-sidebar__nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0.75rem;
    gap: 4px;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .fgs-sidebar__nav::-webkit-scrollbar { display: none; }

  .fgs-sidebar__link {
    display: inline-flex;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    background: var(--c-surface);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid var(--c-border);
  }
  .fgs-sidebar__link--active {
    background: rgba(147,0,0,0.08) !important;
    border-color: rgba(147,0,0,0.25) !important;
  }
  .fgs-sidebar__active-bar { display: none; }

  /* Logout in the pill row */
  .fgs-sidebar__footer {
    border-top: none;
    padding: 0 0.75rem 0.5rem;
    margin-top: 0;
    display: block;
    overflow-x: auto;
  }

  /* Main content full width */
  .woocommerce-MyAccount-content.fgs-account-main {
    padding: 1.5rem 1rem 3rem;
  }

  /* Dashboard grid — single column on mobile */
  .ma-grid {
    grid-template-columns: 1fr !important;
  }
  .ma-col-main {
    grid-template-columns: 1fr !important;
    grid-column: 1 !important;
  }
  .ma-col-sidebar {
    grid-column: 1 !important;
  }
}

/* ================================================================
   WOOCOMMERCE FULL-WIDTH PAGE TEMPLATE  (v1.0.10)
   Cart, Checkout, Order Received — wide layout, no title.
   ================================================================ */

/* Wrapper — constrained to --max-w-wide with generous side padding */
.fgs-wc-fullwidth-inner {
  width: 100%;
  max-width: var(--max-w-wide, 1520px);
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

/* ================================================================
   CART PAGE — Modern Archivist
   ================================================================ */

/* Extra top breathing room so cart table clears the fixed header */
.woocommerce-cart .fgs-wc-fullwidth-inner {
  max-width: 1240px;
  padding-top: var(--space-2xl) !important;
}

/* ── Cart table ── */
.woocommerce-cart table.shop_table {
  border: none !important;
  border-collapse: collapse;
  width: 100%;
}
/* Extra breathing room above the column headers */
.woocommerce-cart table.shop_table thead tr {
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.woocommerce-cart table.shop_table thead th {
  padding-top: var(--space-lg) !important;  /* space above PRODUCT/PRICE/QUANTITY/SUBTOTAL */
}
.woocommerce-cart table.shop_table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text3);
  border: none !important;
  padding: 0 1rem 1rem;
  font-weight: 500;
}
.woocommerce-cart table.shop_table th:first-child { padding-left: 0; }
.woocommerce-cart table.shop_table td {
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
  padding: 1.25rem 1rem;
  vertical-align: middle;
  font-size: 0.95rem;
}
.woocommerce-cart table.shop_table td:first-child { padding-left: 0; }
.woocommerce-cart table.shop_table .product-name a {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  text-decoration: none;
}
.woocommerce-cart table.shop_table .product-name a:hover { color: var(--c-red); }
.woocommerce-cart table.shop_table .product-price,
.woocommerce-cart table.shop_table .product-subtotal {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--c-red);
}
.woocommerce-cart table.shop_table .product-thumbnail img {
  border-radius: var(--r-md);
  width: 72px;
  height: 72px;
  object-fit: cover;
}
.woocommerce-cart table.shop_table .product-remove a {
  font-size: 1.25rem;
  color: var(--c-text3) !important;
  font-weight: 400;
  transition: color var(--t-fast);
}
.woocommerce-cart table.shop_table .product-remove a:hover {
  color: var(--c-red) !important;
}

/* Quantity input */
.woocommerce-cart .quantity .input-text {
  width: 64px !important;
  text-align: center;
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  padding: 8px 10px !important;
  font-size: 0.95rem !important;
  background: var(--c-surface) !important;
  color: var(--c-text) !important;
}

/* ── Coupon + Update cart actions row ──
   Everything right-aligned: coupon group then Update Cart on the right.  */
.woocommerce-cart table.shop_table td.actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 0.875rem !important;
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
  padding-left: 0 !important;
  border-bottom: none !important;
  background: transparent !important;
}
.woocommerce-cart .coupon {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}
.woocommerce-cart .coupon label { display: none; }
.woocommerce-cart .coupon #coupon_code {
  width: 200px !important;
  flex: 0 0 200px !important;
  padding: 9px 16px !important;
  font-size: 0.875rem !important;
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-full) !important;
  background: var(--c-surface) !important;
  color: var(--c-text) !important;
  box-shadow: none !important;
}
.woocommerce-cart .coupon #coupon_code:focus {
  border-color: var(--c-red) !important;
  box-shadow: 0 0 0 3px var(--c-red-muted) !important;
  outline: none !important;
}
.woocommerce-cart .coupon #coupon_code::placeholder {
  color: var(--c-text3);
  font-size: 0.82rem;
}
/* Apply coupon — compact red pill */
.woocommerce-cart .coupon .button {
  display: inline-block !important;
  width: auto !important;
  padding: 9px 1.25rem !important;
  border-radius: var(--r-full) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  background: var(--c-red) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}
.woocommerce-cart .coupon .button:hover { background: var(--c-red-dark) !important; }

/* Update cart — small outline pill, right side */
.woocommerce-cart td.actions .button[name="update_cart"] {
  display: inline-block !important;
  width: auto !important;
  padding: 9px 1.25rem !important;
  border-radius: var(--r-full) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  background: transparent !important;
  color: var(--c-text2) !important;
  border: 1.5px solid var(--c-border) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.woocommerce-cart td.actions .button[name="update_cart"]:hover {
  border-color: var(--c-red) !important;
  color: var(--c-red) !important;
}
.woocommerce-cart td.actions .button[name="update_cart"]:disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
}

/* ── Cart collaterals ── */
.woocommerce-cart .cart-collaterals {
  margin-top: var(--space-2xl);
  display: flex;
  justify-content: flex-end;
}
.woocommerce-cart .cart_totals {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-xl);
  box-shadow: 0 20px 40px rgba(27,27,27,0.06);
  border: none;
  width: 100%;
  max-width: 460px;
}
.woocommerce-cart .cart_totals h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-lg);
  color: var(--c-text);
}

/* ── Shared totals table rules — cart AND checkout order review ──
   WooCommerce's shop_table_responsive class adds a grey background
   to <th> cells. We reset all that and apply our own padding so
   labels never sit flush against the left edge.               */
.woocommerce-cart .cart_totals table.shop_table,
.woocommerce-checkout #order_review table.shop_table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-checkout #order_review table.shop_table th {
  background: transparent !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text3);
  font-weight: 500;
  /* Ample right padding creates the gap between label and value */
  padding: 1rem 1.75rem 1rem 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
  vertical-align: top;
  width: 36%;
  white-space: nowrap;
}
.woocommerce-cart .cart_totals table.shop_table td,
.woocommerce-checkout #order_review table.shop_table td {
  background: transparent !important;
  padding: 1rem 0 !important;
  font-size: 0.95rem !important;
  color: var(--c-text) !important;
  border: none !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
  vertical-align: top;
}
/* Shipping methods list */
.woocommerce-cart .woocommerce-shipping-methods,
.woocommerce-checkout .woocommerce-shipping-methods {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.woocommerce-cart .woocommerce-shipping-methods li,
.woocommerce-checkout .woocommerce-shipping-methods li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.woocommerce-cart .woocommerce-shipping-destination,
.woocommerce-checkout .woocommerce-shipping-destination {
  font-size: 0.82rem;
  color: var(--c-text3);
  margin-top: 0.5rem;
}
.woocommerce-cart .shipping-calculator-button {
  color: var(--c-green);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.375rem;
}
.woocommerce-cart .shipping-calculator-button:hover { color: var(--c-red); }

/* TOTAL row — large Playfair price, no bottom rule */
.woocommerce-cart .cart_totals .order-total th,
.woocommerce-checkout #order_review .order-total th {
  background: transparent !important;
  border-bottom: none !important;
  padding-top: 1.5rem !important;
  color: var(--c-text3) !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.15em !important;
}
.woocommerce-cart .cart_totals .order-total td,
.woocommerce-checkout #order_review .order-total td {
  background: transparent !important;
  border-bottom: none !important;
  padding-top: 1.5rem !important;
}
.woocommerce-cart .cart_totals .order-total .woocommerce-Price-amount bdi,
.woocommerce-checkout #order_review .order-total .woocommerce-Price-amount bdi {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--c-red);
  display: block;
  line-height: 1.1;
}

/* BNPL / interest-free payment text — boost visibility, fix overlap.
   WooPayments sets --wc-bnpl-margin-bottom: -4px as an inline style
   which causes the BNPL message to pull the checkout button on top of
   the logos. We neutralise it with margin-bottom: 0 and use order to
   push the BNPL text visually below the Proceed to Checkout button. */
.woocommerce-cart #payment-method-message {
  opacity: 1 !important;
  margin-bottom: 0 !important;    /* override WC's --wc-bnpl-margin-bottom: -4px */
  order: 3;                       /* appears after button (order 2) in flex column */
  font-size: 0.82rem;
  color: var(--c-text2) !important;
  text-align: center;
}

/* Proceed to checkout button stack */
.woocommerce-cart .wc-proceed-to-checkout {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
/* Checkout button gets order 2 — appears before BNPL text */
.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  order: 2;
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  border-radius: var(--r-full) !important;
  background: linear-gradient(135deg, #930000, #c00000) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  padding: 0.9375rem 2rem !important;
  border: none !important;
  text-decoration: none !important;
}
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
  opacity: 0.88 !important;
  color: #fff !important;
}
/* Express checkout wrapper (Google Pay etc.) stays at order 4 */
.woocommerce-cart .wcpay-express-checkout-wrapper {
  order: 4;
}

   CHECKOUT PAGE — Modern Archivist
   ================================================================ */

.woocommerce-checkout .fgs-wc-fullwidth-inner {
  max-width: 1200px;
}

/* Two-column layout: form left, order summary right */
.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-2xl);
  align-items: start;
}
.woocommerce-checkout #customer_details { grid-column: 1; }
.woocommerce-checkout #order_review_heading { grid-column: 2; grid-row: 1; }
.woocommerce-checkout #order_review { grid-column: 2; grid-row: 2; }
@media (max-width: 900px) {
  .woocommerce-checkout form.checkout { grid-template-columns: 1fr; }
  .woocommerce-checkout #order_review_heading { grid-column: 1; grid-row: auto; }
  .woocommerce-checkout #order_review { grid-column: 1; grid-row: auto; }
}

/* Checkout form cards */
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-xl);
  box-shadow: 0 20px 40px rgba(27,27,27,0.06);
}

/* Order review heading — generous space above, flush with the card */
.woocommerce-checkout #order_review_heading {
  font-family: 'Playfair Display', serif !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--c-text) !important;
  margin: 0 !important;
  padding: var(--space-xl) !important;
  border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
  box-shadow: 0 20px 40px rgba(27,27,27,0.06) !important;
}
.woocommerce-checkout #order_review {
  border-radius: 0 0 var(--r-lg) var(--r-lg) !important;
  margin-top: 0 !important;
  padding-top: var(--space-lg) !important;
}

/* Section headings inside checkout form */
.woocommerce-checkout h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--c-text);
}

/* Field labels */
.woocommerce-checkout label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text3);
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}
.woocommerce-checkout .required { color: var(--c-red); }

/* Input fields */
.woocommerce-checkout .input-text,
.woocommerce-checkout select,
.woocommerce-checkout textarea {
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  background: var(--c-bg2) !important;
  padding: 11px 14px !important;
  font-size: 0.95rem !important;
  font-family: var(--font-body) !important;
  color: var(--c-text) !important;
  transition: border-color var(--t-fast), box-shadow var(--t-fast) !important;
  box-shadow: none !important;
  width: 100% !important;
}
.woocommerce-checkout .input-text:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus {
  border-color: var(--c-red) !important;
  box-shadow: 0 0 0 3px var(--c-red-muted) !important;
  outline: none !important;
  background: var(--c-surface) !important;
}

/* Field spacing */
.woocommerce-checkout .form-row {
  margin-bottom: 1.25rem !important;
}

/* Have a coupon notification */
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-message {
  background: rgba(51,153,102,0.08) !important;   /* green tint — no hard border */
  border: none !important;
  border-left: 3px solid var(--c-green) !important;
  border-radius: 0 var(--r-md) var(--r-md) 0 !important;
  padding: 1rem 1.25rem !important;
  margin-bottom: var(--space-xl) !important;
  font-size: 0.95rem !important;
  color: var(--c-text2) !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}
/* Remove the default WC exclamation icon */
.woocommerce-checkout .woocommerce-info::before,
.woocommerce-checkout .woocommerce-message::before {
  display: none !important;
}
.woocommerce-checkout .woocommerce-info a,
.woocommerce-checkout .woocommerce-message a {
  color: var(--c-green) !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}
.woocommerce-checkout .woocommerce-info a:hover,
.woocommerce-checkout .woocommerce-message a:hover {
  color: var(--c-red) !important;
}

/* Coupon form that expands when "Click here" is tapped */
.woocommerce-checkout .checkout_coupon {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  box-shadow: 0 20px 40px rgba(27,27,27,0.06);
  margin-bottom: var(--space-xl);
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.woocommerce-checkout .checkout_coupon p { margin: 0; flex: 1; min-width: 0; }
.woocommerce-checkout .checkout_coupon input.input-text {
  border-radius: var(--r-full) !important;
}
.woocommerce-checkout .checkout_coupon .button {
  border-radius: var(--r-full) !important;
  background: var(--c-red) !important;
  color: #fff !important;
  padding: 10px 1.5rem !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  border: none !important;
  white-space: nowrap !important;
}

/* Order review table */
.woocommerce-checkout table.shop_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}
.woocommerce-checkout table.shop_table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text3);
  padding: 0 0 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  font-weight: 500;
}
.woocommerce-checkout table.shop_table td {
  padding: 0.875rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: var(--c-text);
  vertical-align: top;
}
.woocommerce-checkout table.shop_table .order-total td,
.woocommerce-checkout table.shop_table .order-total th {
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: none;
  padding-top: 1.25rem;
  color: var(--c-text);
}
.woocommerce-checkout table.shop_table .order-total .woocommerce-Price-amount {
  color: var(--c-red);
  font-family: 'JetBrains Mono', monospace;
}

/* Payment section */
.woocommerce-checkout #payment {
  background: var(--c-bg2);
  border-radius: var(--r-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}
.woocommerce-checkout #payment .payment_methods {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
}
.woocommerce-checkout #payment .payment_methods li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.95rem;
}

/* Place order button */
.woocommerce-checkout #place_order {
  display: block !important;
  width: 100% !important;
  margin-top: var(--space-lg) !important;
  border-radius: var(--r-full) !important;
  background: linear-gradient(135deg, #930000, #c00000) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 1.05rem !important;
  padding: 1rem 2rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: opacity var(--t-fast) !important;
  text-align: center !important;
}
.woocommerce-checkout #place_order:hover {
  opacity: 0.88 !important;
}

/* ================================================================
   ORDER RECEIVED PAGE
   ================================================================ */

.woocommerce-order-received .fgs-wc-fullwidth-inner {
  max-width: 800px;
}
.woocommerce-order-received .woocommerce-order {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--space-2xl);
  box-shadow: 0 20px 40px rgba(27,27,27,0.06);
}

/* ================================================================
   SHARED WC PAGE — TITLE SUPPRESSION
   ================================================================ */

.woocommerce-cart section > .container > .reveal > h1,
.woocommerce-checkout section > .container > .reveal > h1,
.woocommerce-order-received section > .container > .reveal > h1,
.fgs-wc-fullwidth-page .entry-title {
  display: none !important;
}
.woocommerce-cart #main-content > section:first-of-type,
.woocommerce-checkout #main-content > section:first-of-type {
  display: none !important;
}

/* ================================================================
   ACCOUNT SIDEBAR — LIONS HERALDRY + DARK MODE  (v1.0.11)
   ================================================================ */

/* Lions image replaces text brand mark */
.fgs-sidebar__heraldry {
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: #0a0a0a;  /* near-black matches the lions.png background */
}
.fgs-sidebar__heraldry a {
  display: block;
  text-decoration: none;
}
.fgs-sidebar__lions {
  display: block;
  width: 100%;
  height: auto;
  /* Crop to roughly the top third of the image to show 1 lion clearly */
  aspect-ratio: 260 / 120;
  object-fit: cover;
  object-position: center 20%;
  transition: opacity 0.2s;
}
.fgs-sidebar__heraldry:hover .fgs-sidebar__lions {
  opacity: 0.88;
}

/* ── Dark mode — sidebar ────────────────────────────────────────── */
[data-theme="dark"] .fgs-account-sidebar {
  background: #0f0f18;
}
[data-theme="dark"] .fgs-sidebar__link {
  color: #a0a0b8;
}
[data-theme="dark"] .fgs-sidebar__link:hover {
  color: #e8e6f0;
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .fgs-sidebar__link--active {
  color: #f36 !important;
  background: rgba(255,51,102,0.10) !important;
}
[data-theme="dark"] .fgs-sidebar__active-bar {
  background: #f36;
}
[data-theme="dark"] .fgs-sidebar__link--logout {
  color: #6a6a80 !important;
}
[data-theme="dark"] .fgs-sidebar__link--logout:hover {
  color: #f36 !important;
}
[data-theme="dark"] .fgs-sidebar__footer {
  border-top-color: rgba(255,255,255,0.06);
}

/* ── Dark mode — main account content area ───────────────────────── */
[data-theme="dark"] .woocommerce-MyAccount-content.fgs-account-main {
  background: #0D0D14;
}

/* ── Dark mode — hero gradient ───────────────────────────────────── */
[data-theme="dark"] .ma-hero {
  background: #0a0a0a;
}
