/*!
 * WooCommerce bridge stylesheet.
 *
 * Cart, single-product gallery/tabs, and the shop loop all use theme
 * template overrides that already output main.css's own bespoke classes
 * (.cart-item, .pdp-tabs, .card, …), so none of those need CSS mapped here.
 *
 * Checkout and My Account are deliberately NOT template-overridden (see
 * inc/woocommerce/hooks-cart-checkout-account.php's file header) — their
 * native WooCommerce structure is close enough to the approved design
 * that restyling WooCommerce's own default classes achieves it without
 * copying whole templates. This file is that mapping: every selector on
 * the left is a real WooCommerce/WordPress default class; every
 * declaration reuses main.css's existing design tokens and component
 * patterns rather than introducing new ones.
 */

/* ===== Checkout — .checkout-layout (main.css §14e) via CSS Grid areas ===== */
.woocommerce-checkout form.checkout{
  display:grid;
  grid-template-columns:1fr 380px;
  grid-template-rows:max-content 1fr;
  gap:48px;
  grid-template-areas:"left rhead" "left rbody";
  padding:48px 0 88px;
  align-items:start;
}
.woocommerce-checkout #customer_details{grid-area:left;}
.woocommerce-checkout #order_review_heading{grid-area:rhead; font-size:19px; margin:0 0 6px;}
.woocommerce-checkout #order_review{grid-area:rbody; position:sticky; top:110px;}
.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-checkout-review-order-table{
  border:1px solid var(--line); border-radius:8px; padding:28px; background:var(--white);
}
@media (max-width:1080px){
  .woocommerce-checkout form.checkout{grid-template-columns:1fr; grid-template-areas:"left" "rhead" "rbody";}
  .woocommerce-checkout #order_review{position:static;}
}

/* Each fieldset (billing / shipping / additional info) becomes a .checkout-block card */
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout #payment{
  border:1px solid var(--line); border-radius:8px; padding:30px; margin-bottom:24px; background:var(--white);
}
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3{font-size:19px; margin-bottom:6px;}

/* Form fields -> .field styling */
.woocommerce-checkout .form-row{margin-bottom:20px;}
.woocommerce-checkout .form-row label{display:block; font-size:14px; font-weight:700; margin-bottom:7px;}
.woocommerce-checkout .form-row .required{color:var(--red); text-decoration:none;}
.woocommerce-checkout input.input-text,
.woocommerce-checkout select,
.woocommerce-checkout textarea{
  width:100%; font-family:var(--sans); font-size:16px; color:var(--ink);
  padding:13px 14px; border:1px solid var(--line); border-radius:3px;
  background:var(--white); outline:none; transition:border-color .15s ease, box-shadow .15s ease;
}
.woocommerce-checkout input.input-text:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus{border-color:var(--red); box-shadow:0 0 0 3px rgba(215,38,47,.12);}

/* Shipping methods + payment methods -> .radio-card */
.woocommerce-checkout ul#shipping_method,
.woocommerce-checkout ul.wc_payment_methods{list-style:none; margin:0; padding:0;}
.woocommerce-checkout ul#shipping_method li,
.woocommerce-checkout ul.wc_payment_methods li.wc_payment_method{
  display:flex; gap:14px; align-items:flex-start; border:1px solid var(--line);
  border-radius:6px; padding:18px 20px; margin-bottom:12px; cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.woocommerce-checkout ul#shipping_method li:has(input:checked),
.woocommerce-checkout ul.wc_payment_methods li.wc_payment_method:has(input:checked){
  border-color:var(--red); background:var(--red-tint);
}
.woocommerce-checkout ul#shipping_method input,
.woocommerce-checkout ul.wc_payment_methods input{margin-top:3px; width:18px; height:18px; accent-color:var(--red); flex:none;}
.woocommerce-checkout .payment_box{background:var(--mist); border-left:3px solid var(--slate); padding:18px 20px; border-radius:2px; margin-top:8px; font-size:14px;}

/* Order review line items -> .mini-item */
.woocommerce-checkout .woocommerce-checkout-review-order-table{border:none; padding:0; width:100%;}
.woocommerce-checkout .woocommerce-checkout-review-order-table thead{display:none;}
.woocommerce-checkout .woocommerce-checkout-review-order-table tbody tr{
  display:flex; gap:14px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line);
}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot tr{display:flex; justify-content:space-between; padding:9px 0; font-size:15px;}
.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .order-total{border-top:1px solid var(--line); margin-top:12px; padding-top:16px; font-size:20px; font-weight:800;}

.woocommerce-checkout #place_order{width:100%; margin-top:8px;}
.woocommerce-checkout #place_order,
.woocommerce-checkout .checkout-button{
  font-family:var(--sans); font-weight:600; font-size:16px; border-radius:var(--radius);
  cursor:pointer; border:1px solid transparent; padding:15px 28px;
  background:var(--red); color:var(--white); transition:background .15s ease, transform .15s ease;
}
.woocommerce-checkout #place_order:hover{background:var(--red-deep); transform:translateY(-1px);}

/* ===== My Account — .account-layout (main.css §14f) =====
   Scoped with :has() to the logged-in dashboard (nav + content) only —
   the same body.woocommerce-account/.woocommerce wrapper also holds the
   logged-out login/register view (woocommerce/myaccount/form-login.php's
   .signin-card), which must not be squeezed into the 250px nav column. */
.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation){
  display:grid; grid-template-columns:250px 1fr; gap:48px; padding:56px 0 88px; align-items:start;
}
@media (max-width:1080px){
  .woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation){grid-template-columns:1fr; gap:28px;}
}
.woocommerce-MyAccount-navigation ul{list-style:none; margin:0; padding:0; border:1px solid var(--line); border-radius:6px; overflow:hidden; position:sticky; top:110px;}
.woocommerce-MyAccount-navigation li{border-bottom:1px solid var(--line);}
.woocommerce-MyAccount-navigation li:last-child{border-bottom:none;}
.woocommerce-MyAccount-navigation li a{display:flex; align-items:center; gap:11px; padding:14px 18px; font-size:15px; font-weight:600; color:var(--ink-soft); text-decoration:none;}
.woocommerce-MyAccount-navigation li a:hover{background:var(--mist);}
.woocommerce-MyAccount-navigation li.is-active a{background:var(--red-tint); color:var(--red-deep);}
.woocommerce-MyAccount-content{min-width:0;}
.woocommerce-MyAccount-content > table.shop_table{width:100%; border-collapse:collapse;}
.woocommerce-MyAccount-content table.shop_table th{text-align:left; font-size:16.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--slate); padding:0 12px 12px 0; border-bottom:1px solid var(--line);}
.woocommerce-MyAccount-content table.shop_table td{padding:16px 12px 16px 0; font-size:15.5px; font-weight:500; border-bottom:1px solid var(--line);}
.woocommerce-MyAccount-content .woocommerce-Button,
.woocommerce-MyAccount-content button[type="submit"]{
  font-family:var(--sans); font-weight:600; font-size:15px; border-radius:var(--radius);
  cursor:pointer; border:1px solid transparent; padding:13px 22px;
  background:var(--red); color:var(--white);
}
.woocommerce-MyAccount-content .woocommerce-Address, .woocommerce-MyAccount-content address{
  border:1px solid var(--line); border-radius:8px; padding:26px; background:var(--white);
}
.woocommerce-MyAccount-content form .form-row label{display:block; font-size:14px; font-weight:700; margin-bottom:7px;}
.woocommerce-MyAccount-content form input.input-text,
.woocommerce-MyAccount-content form select{
  width:100%; font-family:var(--sans); font-size:16px; padding:13px 14px; border:1px solid var(--line); border-radius:3px;
}

/* Login/Register forms (rendered on the My Account page when logged out) */
.woocommerce-account .u-columns{display:grid; grid-template-columns:1fr 1fr; gap:64px; padding:64px 0 88px;}
.woocommerce-account .u-column1, .woocommerce-account .u-column2{border:1px solid var(--line); border-radius:8px; padding:38px; background:var(--white);}
@media (max-width:760px){.woocommerce-account .u-columns{grid-template-columns:1fr; gap:32px;}}

/* =============================================================
   Cart / Checkout — WooCommerce Blocks (confirmed live: this
   install renders the block-based Cart/Checkout, not the classic
   shortcode markup the section above targets — see
   POST-MIGRATION-VISUAL-AUDIT.md §5/§12 cause F). WooCommerce's
   own wc-blocks.css/checkout.css already loads before this file
   and fully styles/functions the interactive internals (quantity
   steppers, radio controls, coupon form, payment methods) — this
   section only restyles the confirmed outer wrapper classes to
   match the site's design tokens/spacing/card treatment, it does
   not replace or disable any WooCommerce block functionality.

   Wrapper class names below (.wp-block-woocommerce-cart-*,
   .wp-block-woocommerce-checkout-*) were confirmed by fetching a
   real cart/checkout page with an actual product in session. The
   more deeply-nested per-field/per-line-item classes are rendered
   client-side by React after hydration and could not be captured
   by a static fetch in this environment — those are left to
   WooCommerce's own default block styling for now; see
   PHASE-1-QA.md for the recommended manual browser follow-up.
   ============================================================= */

.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout{
  padding:48px 0 88px;
  font-family:var(--sans);
  color:var(--ink);
}

/* Cart: items (left) + order summary (right), matching the original
   two-column cart-layout intent. */
.wp-block-woocommerce-cart .wc-block-cart{
  display:grid; grid-template-columns:1fr 380px; gap:48px; align-items:start;
}
.wp-block-woocommerce-cart-items-block{min-width:0;}
.wp-block-woocommerce-cart-order-summary-block{
  border:1px solid var(--line); border-radius:8px; padding:28px; background:var(--white);
  position:sticky; top:110px;
}
@media (max-width:1080px){
  .wp-block-woocommerce-cart .wc-block-cart{grid-template-columns:1fr;}
  .wp-block-woocommerce-cart-order-summary-block{position:static;}
}

.wc-block-cart__empty-cart__title{font-size:23px; margin-bottom:8px;}

/* Checkout: contact/address/shipping/payment fields (left) + order
   summary (right), matching the original checkout-layout intent. */
.wp-block-woocommerce-checkout .wc-block-checkout__main{min-width:0;}
.wp-block-woocommerce-checkout-fields-block,
.wp-block-woocommerce-checkout-contact-information-block,
.wp-block-woocommerce-checkout-shipping-address-block,
.wp-block-woocommerce-checkout-billing-address-block,
.wp-block-woocommerce-checkout-shipping-method-block,
.wp-block-woocommerce-checkout-payment-block{
  border:1px solid var(--line); border-radius:8px; padding:30px; margin-bottom:24px; background:var(--white);
}
.wp-block-woocommerce-checkout-order-summary-block{
  border:1px solid var(--line); border-radius:8px; padding:28px; background:var(--white);
  position:sticky; top:110px;
}
@media (max-width:1080px){
  .wp-block-woocommerce-checkout-order-summary-block{position:static;}
}

/* Buttons — reuse the same red/radius treatment as .btn-primary and the
   classic-checkout #place_order rule above, applied to WC Blocks' own
   generic button component. Theme CSS is enqueued after wc-blocks.css/
   checkout.css (confirmed via the live <link> order), so these selectors
   win on normal cascade order/specificity without needing !important. */
.wp-block-woocommerce-cart .wc-block-components-button.contained,
.wp-block-woocommerce-checkout .wc-block-components-button.contained,
.wp-block-woocommerce-cart button.wc-block-cart__submit-button,
.wp-block-woocommerce-checkout button.wc-block-components-checkout-place-order-button{
  font-family:var(--sans); font-weight:600; font-size:16px; border-radius:var(--radius);
  background:var(--red); color:var(--white); border:1px solid transparent;
}
.wp-block-woocommerce-cart .wc-block-components-button.contained:hover,
.wp-block-woocommerce-checkout .wc-block-components-button.contained:hover{
  background:var(--red-deep);
}

/* Focus/selected states reuse the same red accent as the classic radio-card
   rule above, applied to WC Blocks' own radio-control component. */
.wp-block-woocommerce-checkout .wc-block-components-radio-control__option--checked,
.wp-block-woocommerce-checkout .wc-block-components-radio-control__option:focus-within{
  border-color:var(--red); background:var(--red-tint);
}
