/* ===================================================================
   Madame Ginger 5 — WooCommerce base
   Loaded on every WooCommerce context (shop, product, cart, checkout,
   account, pages with product shortcodes / WooCommerce blocks).
   Replaces WooCommerce's woocommerce-general / -layout / -smallscreen.
   Page CSS: shop.css, product.css, cart.css, checkout.css, account.css.
   =================================================================== */

/* ---- product grid (woocommerce/loop/loop-start.php) ---- */
.prod-grid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:26px 22px; margin:0; padding:0; list-style:none;}
.prod-grid.columns-1{grid-template-columns:minmax(0,1fr);}
.prod-grid.columns-2{grid-template-columns:repeat(2,minmax(0,1fr));}
.prod-grid.columns-4,.prod-grid.columns-5,.prod-grid.columns-6{grid-template-columns:repeat(4,minmax(0,1fr)); gap:28px 24px;}
.prod-grid > li{min-width:0; display:flex; flex-direction:column; margin:0; padding:0;}
.prod-grid > li > .prod{flex:1 1 auto;}
.prod .add-link.is-out{color:var(--ink); opacity:.45;}
.prod-grid .prod .prod-title a{color:inherit; text-decoration:none !important;}
.prod .prod-title a::after{content:""; position:absolute; inset:0; z-index:1;}

/* Defensive resets: WooCommerce cart/checkout lists should never pick up
   the .entry-content prose treatment (gold underline, gold bullet dot),
   whatever wrapper the page happens to render inside. */
#shipping_method li::before,.products li::before,.prod-cell::before{content:none !important;}

/* category tiles when the shop displays categories */
.prod-grid > li.product-category > a{display:flex; flex-direction:column; height:100%; border:1.5px solid var(--ink); padding:16px; background:var(--paper); box-shadow:6px 6px 0 var(--mgshop); transition:transform .15s ease, box-shadow .15s ease;}
.prod-grid > li.product-category > a:hover{transform:translate(-3px,-3px); box-shadow:9px 9px 0 var(--mgshop);}
.prod-grid > li.product-category img{aspect-ratio:3/4; width:100%; object-fit:cover; margin-bottom:14px;}
.prod-grid > li.product-category h2{font-family:var(--font-mono); font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;}
.prod-grid > li.product-category .count{background:none; opacity:.5; font-weight:600;}

@media (max-width:1080px){
  .prod-grid,.prod-grid[class*="columns-"]{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:640px){
  .prod-grid,.prod-grid[class*="columns-"]{grid-template-columns:minmax(0,1fr); gap:24px;}
  .cross-sells .prod-grid[class*="columns-"]{grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px;}
}

/* ---- buttons: same as .btn ---- */
:where(#main) :is(a.button,button.button,input.button,#respond input#submit),
.wc-block-components-button:not(.is-link),
.wc-block-cart__submit-button{
  --btn-shadow:var(--mgshop);
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--paper); border:1.5px solid var(--ink); color:var(--ink);
  font-family:var(--font-mono); font-weight:600; font-size:13px; line-height:1.2; text-transform:uppercase; letter-spacing:.04em; text-align:center;
  padding:13px 24px; border-radius:10px !important; box-shadow:4px 4px 0 var(--btn-shadow);
  transition:transform .15s ease, box-shadow .15s ease, opacity .15s ease; cursor:pointer; text-decoration:none; min-height:0;
}
:where(#main) :is(a.button,button.button,input.button,#respond input#submit):hover,
.wc-block-components-button:not(.is-link):hover{transform:translate(-2px,-2px); box-shadow:6px 6px 0 var(--btn-shadow); color:var(--ink); background:var(--paper);}
:where(#main) :is(a.button,button.button,input.button):active{transform:none; box-shadow:2px 2px 0 var(--btn-shadow);}
:where(#main) :is(a.button,button.button,input.button):is(:disabled,.disabled,[disabled]){opacity:.4; cursor:not-allowed; transform:none; box-shadow:4px 4px 0 var(--line);}
:where(#main) :is(a.button,button.button).loading{opacity:.6; pointer-events:none;}
:where(#main) :is(a.button,button.button).alt{--btn-shadow:var(--mgshop);}
:where(#main) a.added_to_cart{font-family:var(--font-mono); font-size:11px; font-weight:700; text-transform:uppercase; color:var(--mgshop); margin-left:10px;}

/* ---- forms ---- */
:where(#main) form .form-row{margin:0 0 16px; padding:0;}
:where(#main) form .form-row > label,
:where(#main) .woocommerce-form-row > label,
:where(#main) fieldset > p > label{
  display:block; font-family:var(--font-mono); font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; color:rgba(27,23,18,.7); line-height:1.4;
}
:where(#main) form .form-row label.checkbox,
:where(#main) label.woocommerce-form__label-for-checkbox{
  display:flex; align-items:flex-start; gap:10px; font-family:var(--font); font-size:13.5px; font-weight:500; text-transform:none; letter-spacing:0; color:var(--ink); cursor:pointer;
}
:where(#main) .required{color:var(--orange); text-decoration:none; border:0;}
:where(#main) .optional{opacity:.6; text-transform:none; letter-spacing:0;}
:where(#main) .woocommerce-input-wrapper{display:block;}

:where(#main) :is(input.input-text,input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="password"],input[type="search"],input[type="url"],input[type="date"],textarea,select){
  width:100%; min-height:46px; background:var(--paper); border:1.5px solid var(--ink); border-radius:0; padding:11px 13px;
  font-family:var(--font); font-size:14px; line-height:1.4; color:var(--ink); box-shadow:none; appearance:none;
}
:where(#main) textarea{min-height:90px; resize:vertical;}
:where(#main) select{
  padding-right:36px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23F04E23'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 13px center; background-size:10px 6px;
}
:where(#main) :is(input,textarea,select)::placeholder{color:rgba(27,23,18,.4);}
:where(#main) :is(input.input-text,input[type="text"],input[type="email"],input[type="tel"],input[type="number"],input[type="password"],input[type="search"],input[type="url"],input[type="date"],textarea,select):focus{outline:none; box-shadow:4px 4px 0 var(--gold);}
:where(#main) :is(input[type="checkbox"],input[type="radio"]){width:17px; height:17px; min-height:0; margin:2px 0 0; flex-shrink:0; accent-color:var(--ink); appearance:auto;}
:where(#main) .form-row.woocommerce-invalid :is(input.input-text,select,textarea),
:where(#main) .form-row.woocommerce-invalid .select2-selection{border-color:var(--orange); box-shadow:4px 4px 0 var(--orange-soft);}
:where(#main) .checkout-inline-error-message{color:var(--orange); font-size:12px; font-weight:600; margin-top:6px;}
:where(#main) .password-input{position:relative; display:block;}
:where(#main) .show-password-input{position:absolute; right:10px; top:50%; transform:translateY(-50%); width:28px; height:28px; opacity:.55;}
:where(#main) .show-password-input::before{content:"👁"; font-size:15px;}
:where(#main) .show-password-input.display-password{opacity:1;}
:where(#main) .woocommerce-password-strength{font-family:var(--font-mono); font-size:11px; font-weight:600; padding:6px 10px; margin-top:6px; background:var(--cream);}
:where(#main) .woocommerce-password-strength.strong{background:var(--green-soft); color:var(--green-deep);}
:where(#main) .woocommerce-password-strength.bad,
:where(#main) .woocommerce-password-strength.short{background:var(--orange-soft); color:var(--orange);}
:where(#main) .woocommerce-password-hint{display:block; font-size:12px; opacity:.6; margin-top:6px;}

/* two-column address / account field grids */
:where(#main) :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper,.woocommerce-additional-fields__field-wrapper){display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:16px;}
:where(#main) :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper,.woocommerce-additional-fields__field-wrapper) > *{grid-column:1 / -1;}
:where(#main) :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper) > .form-row-first{grid-column:1;}
:where(#main) :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper) > .form-row-last{grid-column:2;}
@media (max-width:640px){
  :where(#main) :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper,.woocommerce-additional-fields__field-wrapper){grid-template-columns:minmax(0,1fr);}
  :where(#main) :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper,.woocommerce-address-fields__field-wrapper) > :is(.form-row-first,.form-row-last){grid-column:1;}
}

/* ---- select2 / selectWoo (country, state) ---- */
.select2-container .select2-selection--single{height:46px; border:1.5px solid var(--ink); border-radius:0; background:var(--paper);}
.select2-container--default .select2-selection--single .select2-selection__rendered{line-height:43px; padding-left:13px; padding-right:34px; color:var(--ink); font-family:var(--font); font-size:14px;}
.select2-container--default .select2-selection--single .select2-selection__arrow{height:44px; right:8px;}
.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:var(--orange) transparent transparent transparent;}
.select2-container--focus .select2-selection--single,.select2-container--open .select2-selection--single{box-shadow:4px 4px 0 var(--gold);}
.select2-dropdown{border:1.5px solid var(--ink); border-radius:0; font-family:var(--font); font-size:14px;}
.select2-search--dropdown .select2-search__field{border:1.5px solid var(--ink) !important; border-radius:0; padding:8px 10px;}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected]{background:var(--ink); color:var(--cream);}
.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option[data-selected="true"]{background:var(--cream); color:var(--ink);}

/* ---- notices ---- */
.woocommerce-notices-wrapper:empty{display:none;}
.woocommerce-message,.woocommerce-info,.woocommerce-error,.woocommerce-noreviews,p.no-comments{
  --accent:var(--mgshop);
  position:relative; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 18px;
  margin:0 0 28px; padding:16px 20px; list-style:none;
  background:var(--paper); border:1.5px solid var(--ink); box-shadow:5px 5px 0 var(--accent);
  font-size:14.5px; font-weight:600; line-height:1.5; color:var(--ink);
}
.woocommerce-info,.woocommerce-noreviews,p.no-comments{--accent:var(--gold);}
.woocommerce-error{--accent:var(--orange); flex-direction:column; align-items:flex-start; gap:6px;}
.woocommerce-error li{margin:0; padding:0;}
.woocommerce-error li::before{content:"! "; color:var(--orange); font-family:var(--font-mono); font-weight:700;}
.woocommerce-message .button,.woocommerce-info .button,.woocommerce-error .button{order:2; margin-left:auto; padding:9px 16px !important; font-size:11.5px !important; box-shadow:3px 3px 0 var(--btn-shadow) !important;}
:is(.woocommerce-message,.woocommerce-info,.woocommerce-error) a:not(.button){text-decoration:underline; text-decoration-color:var(--gold); text-decoration-thickness:2px; text-underline-offset:3px;}
.woocommerce-message:focus,.woocommerce-error:focus,.woocommerce-info:focus{outline:2px solid var(--lavender-deep); outline-offset:3px;}

/* ---- store notice / loading overlay ---- */
.woocommerce-store-notice,p.demo_store{position:fixed; left:0; right:0; bottom:0; z-index:99; margin:0; padding:12px var(--gutter); background:var(--ink); color:var(--cream); font-family:var(--font-mono); font-size:12px; font-weight:600; text-align:center; letter-spacing:.03em;}
.woocommerce-store-notice__dismiss-link{color:var(--gold); margin-left:12px; text-decoration:underline;}
.blockUI.blockOverlay{position:relative;}
.blockUI.blockOverlay::before{content:""; position:absolute; top:50%; left:50%; width:22px; height:22px; margin:-11px 0 0 -11px; border:2px solid var(--ink); border-right-color:transparent; border-radius:50% !important; animation:mg-spin .7s linear infinite;}
@keyframes mg-spin{to{transform:rotate(360deg);}}

/* ---- quantity stepper ---- */
.quantity{display:inline-flex; align-items:stretch; vertical-align:middle;}
.quantity.qty-box{border:1.5px solid var(--ink); background:var(--paper);}
.quantity input.qty{width:52px; min-height:46px; text-align:center; padding:0 4px; border:1.5px solid var(--ink); font-family:var(--font-mono); font-size:14px; font-weight:600; -moz-appearance:textfield; appearance:textfield;}
.quantity.qty-box input.qty{border:0; border-left:1.5px solid var(--ink); border-right:1.5px solid var(--ink); box-shadow:none;}
.quantity input.qty::-webkit-outer-spin-button,.quantity input.qty::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.quantity input.qty:focus{outline:none; background:var(--cream); box-shadow:none;}
.quantity input.qty:focus-visible{outline:2px solid var(--lavender-deep); outline-offset:-3px;}
.qty-step{width:40px; display:flex; align-items:center; justify-content:center; font-size:17px; font-weight:600; line-height:1; color:var(--ink); background:transparent; transition:background .12s ease;}
.qty-step:hover{background:var(--cream);}
.qty-step:disabled{opacity:.3; cursor:not-allowed; background:transparent;}

/* ---- ratings ---- */
.star-rating{position:relative; display:inline-block; width:5.6em; height:1.1em; overflow:hidden; font-family:Arial, sans-serif; font-size:14px; line-height:1.1; letter-spacing:.12em; vertical-align:middle;}
.star-rating::before{content:"★★★★★"; position:absolute; top:0; left:0; color:var(--line);}
.star-rating span{position:absolute; top:0; left:0; height:100%; overflow:hidden; padding-top:1.5em;}
.star-rating span::before{content:"★★★★★"; position:absolute; top:0; left:0; color:var(--gold);}
p.stars{margin:0 0 16px;}
p.stars a{position:relative; display:inline-block; width:1.3em; height:1.3em; font-size:20px; text-indent:-9999px; overflow:hidden; text-decoration:none;}
p.stars a::before{content:"★"; position:absolute; inset:0; text-indent:0; color:var(--line); line-height:1.3;}
p.stars:hover a::before,p.stars.selected a.active::before,p.stars.selected a:not(.active)::before{color:var(--gold);}
p.stars:hover a:hover ~ a::before,p.stars.selected a.active ~ a::before{color:var(--line);}

/* ---- tables (orders, order details, account) ---- */
:where(#main) table.shop_table:not(.co-review){width:100%; border-collapse:collapse; margin:0 0 28px; border-top:2px solid var(--ink); font-size:14px;}
:where(#main) table.shop_table:not(.co-review) :is(th,td){padding:12px 10px; text-align:left; vertical-align:middle; border-bottom:1px solid var(--line-soft);}
:where(#main) table.shop_table:not(.co-review) thead th{font-family:var(--font-mono); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; border-bottom:1.5px solid var(--ink);}
:where(#main) table.shop_table:not(.co-review) tfoot th{font-weight:600;}
:where(#main) table.shop_table:not(.co-review) tfoot tr:last-child :is(th,td){border-bottom:0; border-top:2px solid var(--ink); font-size:16px; font-weight:700;}
:where(#main) table.shop_table .woocommerce-Price-amount{font-family:var(--font-mono); font-weight:600;}
:where(#main) table.shop_table .button{padding:8px 12px; font-size:11px; box-shadow:3px 3px 0 var(--btn-shadow); margin:2px 4px 2px 0;}
@media (max-width:640px){
  :where(#main) table.shop_table_responsive thead{display:none;}
  :where(#main) table.shop_table_responsive tbody tr{display:block; border-bottom:1.5px solid var(--line-soft); padding:6px 0;}
  :where(#main) table.shop_table_responsive tbody :is(th,td){display:flex; justify-content:space-between; gap:12px; text-align:right; border:0; padding:6px 0;}
  :where(#main) table.shop_table_responsive tbody :is(th,td)[data-title]::before{content:attr(data-title); font-family:var(--font-mono); font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; opacity:.6; text-align:left;}
}

:where(#main) address{font-style:normal; line-height:1.65; border:1.5px solid var(--ink); padding:18px 20px; background:var(--paper);}
:where(#main) :is(.woocommerce-order-details__title,.woocommerce-column__title,.woocommerce-customer-details h2,.wc-bacs-bank-details-heading,.woocommerce-order-downloads__title){font-family:var(--font-display); font-size:19px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; margin:36px 0 16px;}
:where(#main) .woocommerce-columns--addresses{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px;}
:where(#main) .wc-item-meta{list-style:none; margin:6px 0 0; padding:0; font-size:12.5px; opacity:.75;}
:where(#main) .wc-item-meta :is(strong,p){display:inline; margin:0;}
@media (max-width:640px){ :where(#main) .woocommerce-columns--addresses{grid-template-columns:minmax(0,1fr);} }

/* cart item meta (variations, add-ons) */
dl.variation{display:grid; grid-template-columns:auto 1fr; gap:2px 8px; margin:4px 0 10px; font-size:12.5px; line-height:1.45;}
dl.variation dt{font-family:var(--font-mono); font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; opacity:.6;}
dl.variation dd{margin:0;}
dl.variation dd p{margin:0;}

/* ---- fallback pagination (infinite scroll replaces it on archives) ---- */
.woocommerce-pagination ul{display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin:40px 0 0; padding:0; list-style:none;}
.woocommerce-pagination .page-numbers{display:flex; align-items:center; justify-content:center; min-width:38px; height:38px; padding:0 8px; border:1.5px solid var(--ink); font-family:var(--font-mono); font-size:12px; font-weight:700;}
.woocommerce-pagination .page-numbers.current{background:var(--ink); color:var(--cream);}
.woocommerce-pagination a.page-numbers:hover{background:var(--cream);}

/* ---- checkout steps (woocommerce/mg-page.php) ---- */
.co-topbar{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px 20px; margin:0 0 18px;}
.co-topbar:empty{display:none;}
.checkout-steps{display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:0; padding:0; list-style:none; font-family:var(--font-mono); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;}
.checkout-steps li{display:flex; align-items:center; gap:10px; opacity:.4;}
.checkout-steps li + li::before{content:"→"; color:var(--ink); opacity:.5;}
.checkout-steps li.is-done{opacity:.75;}
.checkout-steps li.is-done a:hover{text-decoration:underline;}
.checkout-steps li.is-active{opacity:1;}
.checkout-steps li.is-active > span{color:var(--orange);}
.secure-note{display:inline-flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--green);}
.secure-note svg{width:14px; height:14px;}
.mg-woo-page{min-width:0;}

/* ===================================================================
   WooCommerce Cart / Checkout BLOCKS — design tokens only.
   The theme is built for the classic shortcodes (see inc/woocommerce.php).
   =================================================================== */
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout,.wp-block-woocommerce-mini-cart-contents){font-family:var(--font); color:var(--ink);}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) :is(.wc-block-components-title,.wc-block-components-checkout-step__title,.wc-block-cart__totals-title){font-family:var(--font-display) !important; font-weight:700 !important; text-transform:uppercase; letter-spacing:.03em;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) :is(.wc-block-components-text-input input,.wc-block-components-textarea,.wc-blocks-components-select__select,.wc-block-components-combobox .components-combobox-control input.components-combobox-control__input,.wc-block-components-totals-coupon__input input){border:1.5px solid var(--ink) !important; border-radius:0 !important; background:var(--paper) !important; font-family:var(--font) !important; color:var(--ink) !important;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) :is(.wc-block-components-text-input input,.wc-block-components-textarea):focus{box-shadow:4px 4px 0 var(--gold) !important; outline:none !important;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) :is(.wc-block-components-totals-item__value,.wc-block-formatted-money-amount,.wc-block-components-product-price){font-family:var(--font-mono); font-weight:600;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) :is(.wc-block-components-radio-control__option,.wc-block-components-radio-control-accordion-option,.wc-block-components-notice-banner,.wc-block-components-sidebar-layout .wc-block-components-panel){border-radius:0 !important;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) :is(.wc-block-components-radio-control__input,.wc-block-components-checkbox__input){accent-color:var(--ink); border-color:var(--ink) !important;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) .wc-block-components-order-summary-item__quantity{background:var(--ink); color:var(--cream); border-radius:0; box-shadow:none;}
:is(.wp-block-woocommerce-cart,.wp-block-woocommerce-checkout) .wc-block-components-notice-banner{border:1.5px solid var(--ink) !important; box-shadow:5px 5px 0 var(--gold);}
.wc-block-components-button:not(.is-link) .wc-block-components-button__text{font:inherit;}
