/*
 * Build A Shelf Child Theme — woocommerce.css
 * ===========================================================================
 * Site-wide WooCommerce styling override.
 *
 * WHY THIS FILE EXISTS
 * The7 ships an aggressive WooCommerce skin that bleeds The7 cyan (#1EBBF0)
 * through every WC surface (homepage featured, shop, category, cart, checkout,
 * my-account): the `accent-gradient` body class paints all `.button`s with a
 * cyan->green gradient + cyan border in DM Mono, and The7's global accent
 * color tints WC links, focus states, my-account nav tabs, sale badges,
 * ratings, and the native cart progress-steps widget. This file maps EVERY
 * WooCommerce button to the brand button system and replaces every stray
 * The7 accent with brand tokens.
 *
 * SCOPE
 * This file holds the site-wide WC primitives: button system, accent color,
 * forms, the Elementor accent-variable overrides, and the shop/widget chrome.
 * The per-page surfaces — cart, checkout, my-account, notices — were split
 * into `woocommerce-pages.css` when this file hit the 500-line cap.
 *
 * APPROACH
 *   - Primary WC action buttons -> rust fill, no gradient, DM Sans 500, 8px
 *     radius. Secondary buttons (Update cart, etc.) -> brand outline style.
 *   - Accent color: rust for interactive accents, ink for text, sage for
 *     success/savings — never The7 cyan/green.
 *   - Forms: hairline linen-dark borders, 8px radius, rust focus ring.
 *
 * !important USAGE
 * Two late-loaded stylesheets out-specify plain WC selectors: The7's
 * `accent-gradient` body-class rules, and Elementor's `widget-woocommerce-*`
 * 3-class compound selectors. Rather than chase a specificity war,
 * `background-image`, `border`, `border-radius` and accent color/background
 * swaps carry `!important`, each commented at the point of use.
 *
 * Tokens: see `:root` in style.css. File cap: 500 lines.
 * @package BAS_Child
 */

/* ==========================================================================
   1. BUTTON SYSTEM — PRIMARY WC ACTIONS
   loop add-to-cart, single add-to-cart, cart/checkout/account primary buttons,
   and every `.button.alt`. Brand primary CTA: rust fill, no gradient.
   ========================================================================== */

.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt,
.woocommerce .add_to_cart_button, .woocommerce a.product_type_simple,
.woocommerce .single_add_to_cart_button, .woocommerce button.single_add_to_cart_button,
.woocommerce #place_order,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce .woocommerce-form-login__submit, .woocommerce .woocommerce-form-register__submit,
.woocommerce-account .woocommerce-MyAccount-content .button {
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  /* font-family !important: The7 btn-flat skin forces DM Mono on .button. */
  font-family:      var(--font-body) !important;
  font-size:        15px;
  font-weight:      500;
  letter-spacing:   0;
  text-transform:   none;
  line-height:      1.2;
  padding:          12px 24px;
  /* border + radius !important: beat Elementor widget-woocommerce-* 3-class
     selectors that set a 3px/1px radius and a cyan border. */
  border:           1px solid var(--rust) !important;
  border-radius:    8px !important;
  /* background !important: beat body.accent-gradient ... .button gradient. */
  background-color: var(--rust) !important;
  background-image: none !important;
  color:            #ffffff !important; /* beat The7 .button color rule */
  box-shadow:       none;
  text-shadow:      none;
  transition:       background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor:           pointer;
}

.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover,
.woocommerce .add_to_cart_button:hover, .woocommerce a.product_type_simple:hover,
.woocommerce .single_add_to_cart_button:hover, .woocommerce button.single_add_to_cart_button:hover,
.woocommerce #place_order:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce .woocommerce-form-login__submit:hover, .woocommerce .woocommerce-form-register__submit:hover,
.woocommerce-account .woocommerce-MyAccount-content .button:hover {
  background-color: var(--rust-soft) !important; /* beat accent-gradient hover */
  background-image: none !important;
  border-color:     var(--rust-soft) !important;
  color:            #ffffff !important;
}

.woocommerce a.button:focus-visible, .woocommerce button.button:focus-visible,
.woocommerce input.button:focus-visible, .woocommerce a.button.alt:focus-visible,
.woocommerce button.button.alt:focus-visible, .woocommerce #place_order:focus-visible,
.woocommerce .single_add_to_cart_button:focus-visible {
  outline:        2px solid var(--rust);
  outline-offset: 2px;
}

/* Added / disabled state — keep brand colors, just dim. */
.woocommerce a.button.added,
.woocommerce button.button:disabled,
.woocommerce button.button[disabled],
.woocommerce input.button:disabled {
  opacity:    0.55;
  background-color: var(--rust) !important;
  background-image: none !important;
}

/* "View cart" link that appears after an ajax add — keep it as a quiet link,
   not a second loud button stacked under the loop card. */
.woocommerce a.added_to_cart {
  display:          inline-block;
  margin-top:       6px;
  font-family:      var(--font-mono);
  font-size:        11px;
  font-weight:      500;
  text-transform:   uppercase;
  letter-spacing:   1.5px;
  color:            var(--rust);
  background:       none;
  border:           none;
  padding:          0;
}
.woocommerce a.added_to_cart:hover { color: var(--rust-soft); }

/* ==========================================================================
   2. BUTTON SYSTEM — SECONDARY / LESS-PROMINENT WC ACTIONS
   "Update cart", "Apply coupon", "Continue shopping" and other non-`.alt`
   buttons that sit next to a primary action. Brand outline style so the
   primary CTA stays the loudest thing on the page.
   ========================================================================== */

.woocommerce button[name="update_cart"], .woocommerce input[name="update_cart"],
.woocommerce button[name="apply_coupon"], .woocommerce input[name="apply_coupon"],
.woocommerce .coupon .button, .woocommerce .cart .button:not(.checkout-button):not(.alt),
.woocommerce-cart .return-to-shop .button, .woocommerce .woocommerce-form-coupon .button {
  background-color: transparent !important;
  background-image: none !important;
  color:            var(--ink) !important;
  /* border + radius !important: same Elementor widget specificity as §1. */
  border:           1px solid var(--linen-dark) !important;
  border-radius:    8px !important;
  box-shadow:       none;
}

.woocommerce button[name="update_cart"]:hover, .woocommerce input[name="update_cart"]:hover,
.woocommerce button[name="apply_coupon"]:hover, .woocommerce input[name="apply_coupon"]:hover,
.woocommerce .coupon .button:hover, .woocommerce .cart .button:not(.checkout-button):not(.alt):hover,
.woocommerce-cart .return-to-shop .button:hover, .woocommerce .woocommerce-form-coupon .button:hover {
  background-color: transparent !important;
  border-color:     var(--chrome) !important;
  color:            var(--ink) !important;
}

/* Disabled "Update cart" (no changes yet) — keep the outline, just fade. */
.woocommerce button[name="update_cart"]:disabled,
.woocommerce input[name="update_cart"]:disabled {
  opacity: 0.45;
}

/* ==========================================================================
   3. ACCENT COLOR — links, prices, sale badges, ratings, focus
   Replace The7's cyan accent (#1EBBF0) wherever it lands in WC markup.
   ========================================================================== */

/* Links inside WooCommerce content — rust, not cyan. */
.woocommerce a:not(.button):not(.added_to_cart):not(.bas-btn),
.woocommerce-page a:not(.button):not(.added_to_cart):not(.bas-btn) {
  color: var(--rust);
}
.woocommerce a:not(.button):not(.added_to_cart):not(.bas-btn):hover,
.woocommerce-page a:not(.button):not(.added_to_cart):not(.bas-btn):hover {
  color: var(--rust-soft);
}

/* Product titles in the loop — read as ink text, not accent links. */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3 {
  color:       var(--ink);
  font-family: var(--font-display);
}
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link:hover
  .woocommerce-loop-product__title {
  color: var(--rust);
}

/* Prices — ink for the live price, muted for the strike-through compare-at. */
.woocommerce .price,
.woocommerce .price .woocommerce-Price-amount,
.woocommerce ul.products li.product .price {
  color: var(--ink);
}
.woocommerce .price del,
.woocommerce .price del .woocommerce-Price-amount {
  color:   var(--warm-mid);
  opacity: 1;
}
/* The "now" price inside a sale price pair — keep it rust as the accent. */
.woocommerce .price ins,
.woocommerce .price ins .woocommerce-Price-amount {
  color:           var(--rust);
  text-decoration: none;
  font-weight:     500;
}

/* Sale badge — brand sage chip instead of The7's cyan/green pill. */
.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
  background-color: var(--sage) !important; /* beat The7 accent bg */
  background-image: none !important;
  color:            var(--cream);
  font-family:      var(--font-mono);
  font-size:        9px;
  font-weight:      500;
  text-transform:   uppercase;
  letter-spacing:   1.5px;
  border-radius:    4px;
  border:           none;
  min-height:       0;
  min-width:        0;
  line-height:      1;
  padding:          5px 7px;
}

/* Star ratings — terra per the design brief, not The7 accent. */
.woocommerce .star-rating span::before,
.woocommerce .star-rating::before,
.woocommerce p.stars a::before,
.woocommerce p.stars a:hover ~ a::before {
  color: var(--terra);
}
.woocommerce p.stars a::before { color: var(--linen-dark); }
.woocommerce p.stars a.active::before,
.woocommerce p.stars a:hover::before { color: var(--terra); }

/* ==========================================================================
   4. FORMS — quantity inputs, checkout fields, coupon + login fields
   Brand hairline borders, 8px radius, rust focus ring.
   ========================================================================== */

.woocommerce .quantity input.qty,
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea,
.woocommerce-page form .form-row input.input-text, .woocommerce-page form .form-row textarea,
.woocommerce form.checkout_coupon .input-text, .woocommerce form.login .input-text,
.woocommerce form.register .input-text, .woocommerce .select2-container .select2-selection,
.woocommerce #order_comments {
  border:           1px solid var(--linen-dark);
  border-radius:    8px;
  background-color: var(--white);
  color:            var(--ink);
  font-family:      var(--font-body);
  font-size:        14px;
  box-shadow:       none;
}

.woocommerce .quantity input.qty:focus,
.woocommerce form .form-row input.input-text:focus, .woocommerce form .form-row textarea:focus,
.woocommerce-page form .form-row input.input-text:focus, .woocommerce-page form .form-row textarea:focus,
.woocommerce form.checkout_coupon .input-text:focus, .woocommerce form.login .input-text:focus,
.woocommerce form.register .input-text:focus, .woocommerce #order_comments:focus {
  border-color: var(--rust);
  outline:      none;
  box-shadow:   0 0 0 2px rgba(196, 75, 50, 0.15); /* rust @ 15% */
}

/* Validation states — keep WC's red/green semantics but soften to brand. */
.woocommerce form .form-row.woocommerce-invalid input.input-text {
  border-color: var(--rust);
}
.woocommerce form .form-row.woocommerce-validated input.input-text {
  border-color: var(--sage);
}

/* Required-field asterisk — rust, not browser default red. */
.woocommerce form .form-row .required,
.woocommerce form .form-row abbr.required { color: var(--rust); }


/* ==========================================================================
   5. ELEMENTOR WOOCOMMERCE WIDGETS — variable-level override
   Cart/checkout/my-account render via Elementor WC widgets that expose accent
   colors as CSS custom properties (default: The7 cyan). Overriding the vars at
   the widget root is more durable than out-specifying every widget selector.
   ========================================================================== */

.elementor-widget-woocommerce-cart,
.elementor-widget-woocommerce-checkout-page,
.elementor-widget-woocommerce-my-account,
.elementor-widget-wc-cart,
.elementor-widget-woocommerce-cart .woocommerce,
.elementor-widget-woocommerce-checkout-page .woocommerce {
  --links-normal-color:                          var(--rust);
  --links-hover-color:                           var(--rust-soft);
  --order-summary-remove-icon-normal-color:      var(--warm-mid);
  --order-summary-remove-icon-hover-color:       var(--rust);
  --checkout-button-border-radius:               8px;
  --button-border-radius:                        8px;
  --e-global-color-accent:                       var(--rust);
  /* Form fields: Elementor checkout widget + The7 custom.css read these. */
  --forms-fields-border-radius:                  8px;
  --the7-input-border-radius:                    8px;
  --the7-input-border-color:                     var(--linen-dark);
  --forms-fields-border-color:                   var(--linen-dark);
}

/* Remove-icon hover inside the Elementor cart widget — rust fill. */
.elementor-widget-woocommerce-cart .woocommerce a.remove:hover {
  color:            #ffffff !important;
  background-color: var(--rust) !important;
}

/* ==========================================================================
   6. WIDGETS / MISC — price filter, breadcrumb, result count
   ========================================================================== */

/* Shop result count + ordering select — muted mono meta, not accent. */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
  color:       var(--warm-mid);
  font-family: var(--font-body);
}

/* WC breadcrumb links — rust like the rest of WC links. */
.woocommerce .woocommerce-breadcrumb a { color: var(--rust); }
.woocommerce .woocommerce-breadcrumb { color: var(--warm-mid); }

/* Price-filter slider (widget) — rust range + handle, not The7 accent. */
.woocommerce .price_slider .ui-slider-range {
  background-color: var(--rust) !important;
}
.woocommerce .price_slider .ui-slider-handle {
  background-color: var(--ink) !important;
  border:           none;
}

/* ==========================================================================
   7. CART PROGRESS-STEPS WIDGET (.checkout-breadcrumbs)
   The7's native cart/checkout stepper: 3 numbered circles (.checkout-counter)
   joined by 3px connector bars (.checkout-step::before/::after) — all painted
   in The7 cyan. Re-map: current/completed circle -> rust; upcoming circle ->
   linen chip; connectors -> linen-dark. State classes on the <a>: .current /
   .step-complete.
   ========================================================================== */

/* Numbered circle — default (upcoming) state: quiet linen chip, ink number. */
.checkout-breadcrumbs .checkout-counter {
  background-color: var(--linen) !important;   /* beat The7 cyan accent bg */
  background-image: none !important;
  color:            var(--ink) !important;     /* beat The7 white-on-cyan */
  border:           1px solid var(--linen-dark);
}

/* Current + completed step circles — rust fill, white number. */
.checkout-breadcrumbs .current .checkout-counter,
.checkout-breadcrumbs .step-complete .checkout-counter {
  background-color: var(--rust) !important;
  background-image: none !important;
  color:            #ffffff !important;
  border-color:     var(--rust);
}

/* Connector bars between steps — The7 renders these as 3px cyan pseudo-bars
   on .checkout-step. Re-map to a linen-dark neutral hairline. */
.checkout-breadcrumbs .checkout-step::before,
.checkout-breadcrumbs .checkout-step::after,
.checkout-breadcrumbs .checkout-line {
  background-color: var(--linen-dark) !important; /* beat 3px cyan connector */
}

/* Step label text — ink for the active step, muted for the rest. */
.checkout-breadcrumbs .checkout-name { color: var(--warm-mid); }
.checkout-breadcrumbs .current .checkout-name { color: var(--ink); }

/* ==========================================================================
   8. SHOP + CATEGORY PAGES — tighter top spacing, readable breadcrumb
   The archive is the Elementor template "BAS Shop Archive": an HTML breadcrumb
   (.bas-breadcrumb, 10px in primitives.css), then a pale container (.bas-archive)
   whose first block (.bas-section__header) holds the archive title. WooCommerce
   prints no title on archives, so that block is empty but still takes space.
   The three gaps are named values so they can be tuned in one place.
   ========================================================================== */

body.woocommerce-shop,
body.tax-product_cat {
  --bas-shop-top-gap:    20px;  /* main nav -> breadcrumb */
  --bas-shop-crumb-size: 14px;  /* breadcrumb text size */
  --bas-shop-meta-gap:   8px;   /* breadcrumb -> sort row (on top of the breadcrumb's own padding) */
}

/* The7 puts 70px of padding above #main on every page (product.css trims it on single
   products); !important beats The7's generated stylesheet, which loads after this file. */
body.woocommerce-shop #main,
body.tax-product_cat #main { padding-top: var(--bas-shop-top-gap) !important; }

.woocommerce-shop .bas-breadcrumb,
.tax-product_cat .bas-breadcrumb {
  font-size:      var(--bas-shop-crumb-size);
  letter-spacing: 1.8px;
}

/* The archive header only takes space when it really has a title or description. */
.bas-archive > .bas-section__header:not(:has(h1:not(:empty), .term-description)) { display: none; }

/* !important beats Elementor's per-element padding for this container. */
.bas-archive { padding-top: var(--bas-shop-meta-gap) !important; }

/* ==========================================================================
   9. EMPTY CATEGORY — "Products Coming Soon" panel
   Printed by bas_v5_empty_category_coming_soon() (inc/woocommerce.php) in place of the
   archive products widget when a category has no products. Label carries the logo's shelf line.
   ========================================================================== */

.bas-coming-soon { max-width: 620px; margin: 0 auto; padding: 56px 24px 72px; text-align: center; }
.bas-coming-soon .bas-coming-soon__label {
  position: relative; display: inline-block; padding-bottom: 9px; margin-bottom: 16px;
  font-family: var(--font-label); font-size: 13px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--rust);
}
.bas-coming-soon .bas-coming-soon__label::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  border: 2px solid currentColor; border-bottom: 0;
}
.bas-coming-soon .bas-coming-soon__title {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 46px); font-weight: 500;
  letter-spacing: -0.5px; line-height: 1.12; color: var(--navy); margin: 0 0 14px;
}
.bas-coming-soon .bas-coming-soon__text {
  font-family: var(--font-body); font-size: 15px; line-height: 1.7; font-weight: 300;
  color: var(--ink-mid); margin: 0 0 28px;
}
/* The link carries .bas-btn so the "WooCommerce links are rust" rule above skips it (otherwise
   rust text lands on the rust fill); the 0-radius/0-border below square off .bas-btn's rounded look. */
.bas-coming-soon a.bas-coming-soon__link,
.bas-coming-soon a.bas-coming-soon__link:visited {
  display: inline-block; background: var(--rust); color: #fff; text-decoration: none; padding: 14px 32px;
  border: 0; border-radius: 0;
  font-family: var(--font-label); font-size: 11.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; transition: background 0.15s;
}
.bas-coming-soon a.bas-coming-soon__link:hover { background: var(--rust-soft); color: #fff; }

/* ==========================================================================
   10. PRODUCT CARD PHOTOS — show the whole photo, keep rows even
   Cards use the uncropped photo (bas_v5_card_image_size() in inc/woocommerce.php). A fixed 3:2 box with
   object-fit: contain keeps every card the same height even when a product's photo has another shape,
   without ever cutting the picture.
   ========================================================================== */

.woocommerce ul.products li.product a img {
  width:        100%;
  aspect-ratio: 3 / 2;
  object-fit:   contain;
}
