/*
 * Build A Shelf Child Theme — woocommerce-pages.css
 * ===========================================================================
 * Page-specific WooCommerce styling: cart, checkout, my-account, notices.
 *
 * WHY THIS FILE EXISTS
 * `woocommerce.css` holds the site-wide WC primitives (button system, accent
 * color, forms, Elementor accent vars, shop widgets). That file hit the
 * 500-line cap, so the per-page surfaces — cart table/totals, the checkout
 * order-review box + section headings, the my-account navigation, and the WC
 * notice/info banners — were split out here. Both files stay under 500 lines.
 *
 * SCOPE
 *   §1 CART          — shop_table, totals box, remove icon, coupon row
 *   §2 CHECKOUT      — section headings, order-review box + table layout
 *   §3 MY ACCOUNT    — left navigation list, content links
 *   §4 NOTICES       — WC info/message/error banners (site-wide)
 *
 * !important USAGE
 * The7's WooCommerce skin and Elementor's `widget-woocommerce-*` compound
 * selectors out-specify plain WC selectors and force their own font-family,
 * padding, display and accent colors. Where a brand value must beat those,
 * `!important` is used and commented at the point of use.
 *
 * Tokens: see `:root` in style.css. Enqueued by functions.php after
 * `woocommerce.css`. File cap: 500 lines.
 * @package BAS_Child
 */

/* ==========================================================================
   1. CART — table, totals box, coupon row
   Fix colors only; layout left to WooCommerce/The7.
   ========================================================================== */

.woocommerce table.shop_table {
  border:        1px solid var(--linen-dark);
  border-radius: 10px;
}
.woocommerce table.shop_table th {
  font-family: var(--font-mono);
  font-size:   11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color:       var(--warm-mid);
}
.woocommerce table.shop_table td, .woocommerce table.shop_table tr {
  border-top: 1px solid var(--linen-dark);
  color:      var(--ink);
}

/* Remove-item "x" — muted, rust on hover (The7 makes this cyan). */
.woocommerce a.remove {
  color:        var(--warm-mid) !important; /* beat The7 accent color */
  border-radius: 50%;
}
.woocommerce a.remove:hover {
  color:            #ffffff !important;
  background-color: var(--rust) !important;
}

/* Cart totals box. */
.woocommerce .cart_totals h2, .woocommerce-cart .cart-collaterals .cart_totals h2 {
  font-family: var(--font-display);
  color:       var(--ink);
}
.woocommerce-cart .cart-collaterals .cart_totals table { border-color: var(--linen-dark); }

/* ==========================================================================
   2. CHECKOUT — section headings, order-review box + table
   ========================================================================== */

/* --- 2a. Section headings ------------------------------------------------
   The7 ships the billing <h3> and #order_review_heading at 14px / 700 — far
   too small and too heavy for the brand serif (DM Serif Display is a display
   face designed to be set at 400). Restore them to a proper section-heading
   slot in the type scale: serif, 400 weight, ~24px, ink, sensible margin.
   font-family/size/weight carry !important to beat The7's WC heading rule. */
.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-shipping-fields > h3,
.woocommerce-checkout .woocommerce-additional-fields > h3,
.woocommerce-checkout #order_review_heading {
  font-family:    var(--font-display) !important;
  font-size:      24px !important;
  font-weight:    400 !important;
  letter-spacing: -0.5px;
  line-height:    1.2;
  color:          var(--ink);
  margin:         0 0 20px;
}

/* --- 2b. Order-review box ------------------------------------------------
   Owner likes the box color — keep the linen fill, only fix the layout. The7
   leaves the box at padding:0 so the inner table jams against all four
   edges. Give the box real padding + a clean radius/border. */
.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-checkout-review-order {
  background-color: var(--linen);          /* owner-approved color — unchanged */
  border:           1px solid var(--linen-dark);
  border-radius:    10px;
  padding:          24px 28px;
}
.woocommerce-checkout #payment {
  background-color: var(--white);
  border:           1px solid var(--linen-dark);
  border-radius:    10px;
}

/* --- 2c. Order-review table ----------------------------------------------
   The7 strips the row borders, leaves amounts left-aligned, sets Roboto on
   the cells and uses lopsided padding. Rebuild: full-width table, product
   names left / amounts right, hairline row dividers, weighted totals. */
.woocommerce-checkout .woocommerce-checkout-review-order-table {
  width:           100%;
  border:          none;
  border-radius:   0;
  border-collapse: collapse;
  margin:          0;
}

/* Column heads — mono meta label, hairline rule under the head row. */
.woocommerce-checkout .woocommerce-checkout-review-order-table thead th {
  font-family:    var(--font-mono);
  font-size:      11px;
  font-weight:    500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color:          var(--warm-mid);
  padding:        0 0 10px;
  border-bottom:  1px solid var(--linen-dark);
}

/* Body + foot cells — DM Sans, ink text, even vertical rhythm. */
.woocommerce-checkout .woocommerce-checkout-review-order-table td,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th {
  font-family: var(--font-body) !important; /* beat The7's Roboto on WC cells */
  font-size:   14px;
  color:       var(--ink);
  padding:     12px 0;
  vertical-align: top;
}

/* Product name column — left, room before the amount. */
.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name {
  text-align:   left;
  padding-right: 16px;
  line-height:  1.45;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name .product-quantity {
  color: var(--warm-mid);
}

/* Amount column — right-aligned, tabular feel. */
.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total,
.woocommerce-checkout .woocommerce-checkout-review-order-table thead .product-total,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot td {
  text-align:      right;
  white-space:     nowrap;
  font-variant-numeric: tabular-nums;
}

/* Cart item rows — hairline divider between products. */
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody tr {
  border-bottom: 1px solid var(--linen-dark);
}

/* Totals rows (subtotal, shipping, total) — heavier rule above the block,
   labels in mono meta, the final total weighted. */
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr:first-child th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr:first-child td {
  border-top: 1px solid var(--linen-dark);
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot th {
  font-family:    var(--font-mono) !important; /* mono meta label, beat Roboto */
  font-size:      11px;
  font-weight:    500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color:          var(--warm-mid);
  text-align:     left;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total th,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total td {
  border-top:  1px solid var(--ink);
  padding-top: 14px;
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total th {
  color: var(--ink);
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total td,
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total .amount {
  font-size:   16px;
  font-weight: 600;
  color:       var(--ink);
}

/* Payment-method radio accent + selected box. */
.woocommerce-checkout #payment ul.payment_methods { border-bottom: 1px solid var(--linen-dark); }
.woocommerce-checkout #payment div.payment_box {
  background-color: var(--linen);
  color:            var(--ink-mid);
}
.woocommerce-checkout #payment div.payment_box::before { border-bottom-color: var(--linen); }
.woocommerce-checkout input[type="radio"], .woocommerce-checkout input[type="checkbox"] {
  accent-color: var(--rust);
}

/* ==========================================================================
   3. MY ACCOUNT — navigation, content
   The7 paints the nav tabs with a solid cyan fill. Rebuild as a quiet brand
   list: ink links, rust active state, hairline divider. The active/hover
   fill must cover the FULL list item (no white gap at edges) and every item
   must share one uniform height.
   ========================================================================== */

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  border:        1px solid var(--linen-dark);
  border-radius: 10px;
  overflow:      hidden;          /* clip the a-fill to the rounded corners */
  margin:        0;
  padding:       0;
  list-style:    none;
}

/* Each <li> is just a divider host — zero padding so the <a> owns the box. */
.woocommerce-account .woocommerce-MyAccount-navigation li {
  margin:        0;
  padding:       0;
  border-bottom: 1px solid var(--linen-dark);
  list-style:    none;
}
.woocommerce-account .woocommerce-MyAccount-navigation li::before { content: none; }
.woocommerce-account .woocommerce-MyAccount-navigation li:last-child { border-bottom: none; }

/* The <a> is the full-bleed click target: block, uniform padding => uniform
   height, fills the li edge-to-edge so hover/active color covers everything. */
.woocommerce-account .woocommerce-MyAccount-navigation li a {
  display:          block;
  width:            100%;
  box-sizing:       border-box;
  padding:          14px 18px;
  background-color: transparent !important; /* beat The7 solid cyan fill */
  background-image: none !important;
  color:            var(--ink-mid) !important;
  font-family:      var(--font-body);
  font-size:        14px;
  font-weight:      500;
  line-height:      1.3;
  border:           none;
}
.woocommerce-account .woocommerce-MyAccount-navigation li a:hover {
  background-color: var(--linen) !important;
  color:            var(--ink) !important;
}

/* Active item — linen fill covers the whole <a> (= whole <li>), rust text,
   rust inset marker on the left edge. */
.woocommerce-account .woocommerce-MyAccount-navigation li.is-active a {
  background-color: var(--linen) !important;
  color:            var(--rust) !important;
  box-shadow:       inset 3px 0 0 var(--rust); /* rust active marker */
}

.woocommerce-account .woocommerce-MyAccount-content { color: var(--ink); }
.woocommerce-account .woocommerce-MyAccount-content a { color: var(--rust); }

/* ==========================================================================
   4. NOTICES / MESSAGES (site-wide)
   WC info/success/error banners — The7 ships these at padding:0, display:flex
   and Roboto, with its accent on the left border. They render as a cramped
   "weird green box that doesn't fit right" on empty my-account tabs. Re-map
   to a tidy brand box: warm linen surface, sage accent rule, real padding,
   full-width fit in the content column, brand typography.
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-noreviews {
  display:          flex;
  align-items:      center;
  justify-content:  flex-start; /* beat The7's centered notice content */
  flex-wrap:        wrap;
  gap:              12px;
  box-sizing:       border-box;
  width:            100%;
  margin:           0 0 24px;
  text-align:       left;
  /* padding !important: The7 forces padding:0 on WC notices. */
  padding:          16px 20px !important;
  background-color: var(--linen);
  border:           1px solid var(--linen-dark);
  border-top:       3px solid var(--sage);
  border-radius:    8px;
  /* font !important: The7 forces Roboto on WC notices. */
  font-family:      var(--font-body) !important;
  font-size:        14px;
  line-height:      1.5;
  color:            var(--ink);
  list-style:       none;
}
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-noreviews::before {
  position:   static;
  margin:     0;
  color:      var(--sage);
  font-size:  16px;
  line-height: 1;
}

/* The7 wraps the notice copy + button in an inner `.woocommerce-info-text`
   div and centers it. Make that wrapper the full-width flex row instead, so
   the message sits left and the button can push to the right edge. */
.woocommerce-message .woocommerce-info-text,
.woocommerce-info .woocommerce-info-text,
.woocommerce-error .woocommerce-info-text,
.woocommerce-noreviews .woocommerce-info-text {
  display:     flex;
  align-items: center;
  flex-wrap:   wrap;
  gap:         12px;
  flex:        1 1 auto;
  width:       100%;
  margin:      0;             /* beat The7's centering margin on the wrapper */
  text-align:  left;
}

/* Error variant — rust accent + light rust tint, same tidy box. */
.woocommerce-error {
  border-top-color: var(--rust);
  background-color: #F6E4E0; /* rust @ light tint, no token exists */
}
.woocommerce-error::before { color: var(--rust); }

/* Button inside a notice (e.g. "Browse products") — The7 floats it right and
   leaves it cramped. The button lives inside `.woocommerce-info-text` (now a
   flex row), so margin-left:auto pushes it to the right edge. Brand primary
   fill is already supplied by woocommerce.css §1. */
.woocommerce-message a.button,
.woocommerce-info a.button,
.woocommerce-error a.button {
  float:       none !important;   /* beat The7 float:right on notice buttons */
  /* margin-left:auto !important — beat The7's own notice-button margin rule
     and push the button to the right edge of the flex row. */
  margin:      0 0 0 auto !important;
  padding:     8px 18px;
  font-size:   13px;
  color:       #ffffff !important;
}

/* ==========================================================================
   3D Viewer mount (Shelf Liner single-product page)
   The bridge JS swaps the WooCommerce gallery image area for #bas-3d-mount.
   Sized to fill the gallery column with a square-ish frame that matches the
   original gallery footprint, with a warm-paper background.
   ========================================================================== */
.bas-3d-mount {
  width:         100%;
  aspect-ratio:  1 / 1;
  min-height:    480px;
  background:    #FDFCFA;
  border-radius: 4px;
  overflow:      hidden;
  position:      relative;
}

.bas-3d-mount .bas-3d-viewer,
.bas-3d-mount .bas-3d-viewer__canvas-wrap {
  width:   100%;
  height:  100%;
}

/* ==========================================================================
   VARIATIONS FORM — "Clear" reset link styling
   The default WC markup is a bare <a class="reset_variations">Clear</a> that
   appears below the variation dropdowns whenever a selection is active. The
   raw link reads as broken/abandoned; this gives it a proper mono-typographic
   treatment so it looks intentional. Targets both possible parent locations
   (.variations and .woocommerce-variation-add-to-cart) for theme-portability.
   ========================================================================== */
.woocommerce .variations a.reset_variations,
.woocommerce .woocommerce-variation-add-to-cart a.reset_variations,
.woocommerce a.reset_variations {
  display:         inline-block;
  margin:          10px 0 4px;
  padding:         0;
  font-family:     var(--font-mono);
  font-size:       10px;
  letter-spacing:  1.5px;
  text-transform:  uppercase;
  font-weight:     500;
  color:           var(--ink-mid);
  opacity:         0.6;
  text-decoration: none;
  border-bottom:   0.5px solid currentColor;
  padding-bottom:  2px;
  transition:      opacity 0.15s ease, color 0.15s ease;
  visibility:      visible !important;   /* WC hides via inline style on init */
}
.woocommerce .variations a.reset_variations:hover,
.woocommerce .woocommerce-variation-add-to-cart a.reset_variations:hover,
.woocommerce a.reset_variations:hover,
.woocommerce a.reset_variations:focus-visible {
  opacity:         1;
  color:           var(--rust);
  outline:         none;
}
/* Pseudo-content × prefix in rust for the "× CLEAR SELECTION" treatment. */
.woocommerce a.reset_variations::before {
  content:      '\00d7';     /* × multiplication sign */
  color:        var(--rust);
  margin-right: 4px;
  font-size:    11px;
  font-weight:  600;
}
