/*
 * NZ Golf Magazine – Cart & Checkout Design v1.0.3
 * Exclusively visual refinements to the classic WooCommerce cart/checkout.
 * All selectors are scoped to body classes added only on those two pages.
 * No prices/taxes, checkout behaviour, payment methods, or inputs are changed.
 */

body.nzgcd-ui {
  --nzgcd-ink: #181b1b;
  --nzgcd-muted: #596268;
  --nzgcd-green: #146a44;
  --nzgcd-green-dark: #0e5336;
  --nzgcd-border: #e1e6e5;
  --nzgcd-soft: #f6f8f7;
  --nzgcd-radius: 13px;
}

/* Keep the shopping journey focussed, without touching magazine/editorial pages.
   Advertising wrappers reflect common Newspaper/tagDiv and AdRotate markup.
   Other publisher-specific ad placements can be identified during staging QA. */
body.nzgcd-ui .td-header-rec-wrap,
body.nzgcd-ui .td-header-ad-wrap,
body.nzgcd-ui .td-a-rec,
body.nzgcd-ui .td_block_ad_box,
body.nzgcd-ui .td-block-ad-box,
body.nzgcd-ui .td-adspot-title,
body.nzgcd-ui .adrotate_widgets,
body.nzgcd-ui .adrotate-widget {
  display: none !important;
}

body.nzgcd-ui .woocommerce,
body.nzgcd-ui .woocommerce-page {
  box-sizing: border-box;
}
body.nzgcd-ui .woocommerce *,
body.nzgcd-ui .woocommerce *::before,
body.nzgcd-ui .woocommerce *::after {
  box-sizing: border-box;
}
body.nzgcd-ui .woocommerce {
  color: var(--nzgcd-ink);
  font-size: 15px;
}
body.nzgcd-ui .woocommerce a {
  text-underline-offset: 3px;
}
body.nzgcd-ui .woocommerce :is(input, select, textarea, button, a):focus-visible {
  outline: 2px solid var(--nzgcd-green);
  outline-offset: 2px;
}
body.nzgcd-ui .woocommerce :is(input.input-text, textarea, select) {
  background: #fff;
  border: 1px solid #cad2cf;
  border-radius: 7px;
  color: var(--nzgcd-ink);
  font: inherit;
  min-height: 43px;
  padding: 10px 12px;
  max-width: 100%;
  box-shadow: none;
}
body.nzgcd-ui .woocommerce :is(input.input-text, textarea, select):focus {
  border-color: var(--nzgcd-green);
}
body.nzgcd-ui .woocommerce textarea { min-height: 86px; resize: vertical; }
body.nzgcd-ui .woocommerce :is(button.button, a.button, a.checkout-button, button#place_order, input.button) {
  background: var(--nzgcd-ink);
  border: 1px solid var(--nzgcd-ink);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  min-height: 44px;
  padding: 11px 18px;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
}
body.nzgcd-ui .woocommerce :is(button.button, a.button, a.checkout-button, button#place_order, input.button):hover:not(:disabled) {
  background: #343a39;
  border-color: #343a39;
  color: #fff;
}
body.nzgcd-ui .woocommerce :is(button.button, input.button):disabled {
  opacity: .48;
  cursor: default;
}
body.nzgcd-ui .woocommerce :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  border: 1px solid var(--nzgcd-border);
  border-left: 4px solid var(--nzgcd-green);
  border-radius: 9px;
  color: var(--nzgcd-ink);
  background: #fff;
  padding: 16px 18px;
  margin: 0 0 18px;
  box-shadow: none;
}
body.nzgcd-ui .woocommerce :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
  position: static;
  display: inline-block;
  margin-right: 8px;
  color: var(--nzgcd-green);
}
body.nzgcd-ui .woocommerce .woocommerce-error { border-left-color: #bf3f36; }
body.nzgcd-ui .woocommerce .woocommerce-error::before { color: #bf3f36; }
body.nzgcd-ui .woocommerce .woocommerce-message .button {
  float: none;
  display: inline-block;
  margin: 0 8px 4px 0;
  min-height: 36px;
  padding: 8px 12px;
}

/* =================== CART =================== */
body.nzgcd-cart .woocommerce > .woocommerce-cart-form,
body.nzgcd-cart .woocommerce > .cart-collaterals {
  min-width: 0;
  width: auto !important;
  max-width: 100%;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
}
body.nzgcd-cart .woocommerce > .cart-collaterals {
  display: block !important;
  position: static !important;
}
body.nzgcd-cart .woocommerce .cart-collaterals .cart_totals {
  display: block !important;
  float: none !important;
  clear: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--nzgcd-border);
  border-radius: var(--nzgcd-radius);
  box-shadow: 0 6px 22px rgba(0,0,0,.035);
}
body.nzgcd-cart .woocommerce .cart-collaterals::before,
body.nzgcd-cart .woocommerce .cart-collaterals::after {
  display: none !important;
}
body.nzgcd-cart .woocommerce .cart-collaterals .cart_totals > h2 {
  float: none !important;
  display: block !important;
  width: auto !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  font-size: 20px;
  line-height: 1.35;
  color: var(--nzgcd-ink);
  text-align: left;
}
body.nzgcd-cart .woocommerce .woocommerce-cart-form {
  background: #fff;
  border: 1px solid var(--nzgcd-border);
  border-radius: var(--nzgcd-radius);
  padding: 15px;
  box-shadow: 0 6px 22px rgba(0,0,0,.035);
}
body.nzgcd-cart .woocommerce table.shop_table,
body.nzgcd-checkout .woocommerce table.shop_table {
  width: 100% !important;
  border: 0 !important;
  border-collapse: collapse !important;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  background: transparent;
  table-layout: auto;
}
body.nzgcd-cart .woocommerce table.shop_table th,
body.nzgcd-cart .woocommerce table.shop_table td,
body.nzgcd-checkout .woocommerce table.shop_table th,
body.nzgcd-checkout .woocommerce table.shop_table td {
  border: 0;
  border-bottom: 1px solid var(--nzgcd-border);
  padding: 12px 8px;
  vertical-align: middle;
}
body.nzgcd-cart .woocommerce table.shop_table thead th {
  color: var(--nzgcd-muted);
  font-weight: 650;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
body.nzgcd-cart .woocommerce td.product-name a {
  color: var(--nzgcd-ink);
  font-weight: 700;
  text-decoration: none;
}
body.nzgcd-cart .woocommerce td.product-thumbnail img {
  width: 66px;
  height: 66px;
  max-width: 66px;
  object-fit: cover;
  border-radius: 8px;
}
body.nzgcd-cart .woocommerce td.product-remove a.remove {
  color: #7e8984 !important;
  font-size: 22px;
  line-height: 24px;
}
body.nzgcd-cart .woocommerce td.product-remove a.remove:hover { color: #be342c !important; background: transparent; }
body.nzgcd-cart .woocommerce .quantity .qty {
  display: inline-block;
  width: 70px;
  max-width: 100%;
  min-height: 42px;
  text-align: center;
  padding: 6px;
}
body.nzgcd-cart .woocommerce .actions {
  background: var(--nzgcd-soft);
  padding: 15px !important;
  border-radius: 9px;
  border-bottom: 0 !important;
}
body.nzgcd-cart .woocommerce .actions .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  float: none;
  align-items: center;
}
body.nzgcd-cart .woocommerce .actions .coupon #coupon_code {
  width: min(220px, 100%);
  flex: 1 1 170px;
  float: none;
  margin: 0;
}
body.nzgcd-cart .woocommerce .actions .coupon > button {
  float: none;
  margin: 0;
}
body.nzgcd-cart .woocommerce .actions > button[name="update_cart"] {
  float: none;
  display: block;
  margin: 12px 0 0 auto;
}
body.nzgcd-cart .woocommerce .cart_totals table th,
body.nzgcd-cart .woocommerce .cart_totals table td {
  border-bottom: 1px solid var(--nzgcd-border);
  padding: 12px 5px;
  font-size: 14px;
  text-align: left;
}
body.nzgcd-cart .woocommerce .cart_totals table td {
  text-align: right;
}
body.nzgcd-cart .woocommerce .cart_totals table tr.order-total th,
body.nzgcd-cart .woocommerce .cart_totals table tr.order-total td {
  border: 0;
  background: #eaf4ed;
  padding: 14px 9px;
  font-size: 17px;
  font-weight: 750;
}
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout {
  margin: 12px 0 0;
  padding: 0 !important;
  width: 100%;
}
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button {
  width: 100%;
  display: block;
  text-align: center;
  background: var(--nzgcd-green);
  border-color: var(--nzgcd-green);
  padding: 13px;
  font-size: 15px;
  margin: 0 0 12px;
}
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--nzgcd-green-dark);
  border-color: var(--nzgcd-green-dark);
}
body.nzgcd-cart .woocommerce :is(.wcpay-payment-request-wrapper, .wcpay-express-checkout-wrapper, #wcpay-payment-request-wrapper) {
  clear: both;
  max-width: 100%;
  margin: 10px 0 0;
}

/* =================== CHECKOUT =================== */
body.nzgcd-checkout .woocommerce form.checkout.woocommerce-checkout {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
body.nzgcd-checkout .woocommerce form.checkout #customer_details,
body.nzgcd-checkout .woocommerce form.checkout #order_review {
  min-width: 0;
}
body.nzgcd-checkout .woocommerce #customer_details .col-1,
body.nzgcd-checkout .woocommerce #customer_details .col-2 {
  width: 100% !important;
  max-width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: both;
}
body.nzgcd-checkout .woocommerce #customer_details .col-1 {
  background: #fff;
  border: 1px solid var(--nzgcd-border);
  border-radius: var(--nzgcd-radius);
  padding: 19px !important;
  box-shadow: 0 6px 22px rgba(0,0,0,.035);
}
body.nzgcd-checkout .woocommerce #customer_details .col-2 {
  margin-top: 14px !important;
  background: #fff;
  border: 1px solid var(--nzgcd-border);
  border-radius: var(--nzgcd-radius);
  padding: 19px !important;
}
body.nzgcd-checkout .woocommerce #customer_details :is(h3, h3#ship-to-different-address),
body.nzgcd-checkout .woocommerce h3#order_review_heading {
  color: var(--nzgcd-ink);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 750;
  margin: 0 0 15px !important;
  padding: 0;
  text-transform: none;
}
body.nzgcd-checkout .woocommerce #customer_details .woocommerce-billing-fields__field-wrapper,
body.nzgcd-checkout .woocommerce #customer_details .woocommerce-shipping-fields__field-wrapper,
body.nzgcd-checkout .woocommerce #customer_details .woocommerce-additional-fields__field-wrapper {
  width: 100%;
  max-width: 100%;
}
body.nzgcd-checkout .woocommerce form .form-row {
  margin: 0 0 13px !important;
  padding: 0 !important;
  width: 100%;
  max-width: 100%;
  float: none;
  clear: none;
}
body.nzgcd-checkout .woocommerce form .form-row label {
  color: var(--nzgcd-ink);
  display: block;
  font-weight: 650;
  font-size: 13px;
  margin: 0 0 5px;
  line-height: 1.45;
}
body.nzgcd-checkout .woocommerce form .form-row .required { color: #b8332c; }
body.nzgcd-checkout .woocommerce form .form-row .woocommerce-input-wrapper { display: block; width: 100%; }
body.nzgcd-checkout .woocommerce form .form-row :is(input.input-text, select, textarea) {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
body.nzgcd-checkout .woocommerce .select2-container { width: 100% !important; }
body.nzgcd-checkout .woocommerce .select2-container .select2-selection--single {
  min-height: 43px;
  border: 1px solid #cad2cf;
  border-radius: 7px;
}
body.nzgcd-checkout .woocommerce .select2-container .select2-selection__rendered {
  line-height: 41px;
  padding-left: 12px;
}
body.nzgcd-checkout .woocommerce .select2-container .select2-selection__arrow { height: 41px; }
body.nzgcd-checkout .woocommerce h3#order_review_heading {
  margin: 19px 0 11px !important;
}
body.nzgcd-checkout .woocommerce #order_review {
  float: none !important;
  clear: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 18px !important;
  background: #fff;
  border: 1px solid var(--nzgcd-border);
  border-radius: var(--nzgcd-radius);
  box-shadow: 0 6px 22px rgba(0,0,0,.035);
}
body.nzgcd-checkout .woocommerce #order_review table.shop_table th,
body.nzgcd-checkout .woocommerce #order_review table.shop_table td {
  padding: 12px 7px;
  font-size: 14px;
  line-height: 1.4;
}
body.nzgcd-checkout .woocommerce #order_review table.shop_table .order-total th,
body.nzgcd-checkout .woocommerce #order_review table.shop_table .order-total td {
  background: #eaf4ed;
  color: #101916;
  font-weight: 750;
  font-size: 18px;
  border-bottom: 0;
  padding: 14px 9px;
}
body.nzgcd-checkout .woocommerce #order_review table.shop_table .product-total,
body.nzgcd-checkout .woocommerce #order_review table.shop_table tfoot td {
  text-align: right;
  white-space: normal;
}
body.nzgcd-checkout .woocommerce #payment {
  background: var(--nzgcd-soft);
  border: 1px solid var(--nzgcd-border);
  border-radius: 10px;
  padding: 10px;
  margin-top: 14px;
}
body.nzgcd-checkout .woocommerce #payment :is(ul.payment_methods, .place-order) {
  padding: 10px !important;
  margin: 0 !important;
  background: transparent;
  border: 0;
}
body.nzgcd-checkout .woocommerce #payment ul.payment_methods li {
  padding: 7px 0;
  margin: 0;
  min-width: 0;
}
body.nzgcd-checkout .woocommerce #payment ul.payment_methods li label {
  display: inline-block;
  vertical-align: middle;
  color: var(--nzgcd-ink);
  font-weight: 650;
  max-width: calc(100% - 35px);
  overflow-wrap: anywhere;
}
body.nzgcd-checkout .woocommerce #payment ul.payment_methods li img {
  max-height: 24px;
  max-width: 100%;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}
body.nzgcd-checkout .woocommerce #payment .payment_box {
  border-radius: 8px;
  background: #fff;
  color: var(--nzgcd-ink);
  margin: 9px 0 0;
  padding: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
body.nzgcd-checkout .woocommerce #payment .payment_box::before { display: none; }
body.nzgcd-checkout .woocommerce #payment .form-row.place-order {
  width: 100%;
  margin: 0 !important;
}
body.nzgcd-checkout .woocommerce #payment button#place_order {
  display: block;
  width: 100%;
  float: none !important;
  background: var(--nzgcd-green);
  border-color: var(--nzgcd-green);
  padding: 14px;
  font-size: 15px;
  min-height: 50px;
}
body.nzgcd-checkout .woocommerce #payment button#place_order:hover {
  background: var(--nzgcd-green-dark);
  border-color: var(--nzgcd-green-dark);
}
body.nzgcd-checkout .woocommerce :is(.woocommerce-form-coupon-toggle, .woocommerce-form-login-toggle) {
  margin-bottom: 12px;
}
body.nzgcd-checkout .woocommerce :is(form.checkout_coupon, form.woocommerce-form-login) {
  padding: 16px;
  border: 1px solid var(--nzgcd-border);
  border-radius: 9px;
  margin: 0 0 16px;
}
body.nzgcd-checkout .woocommerce :is(.wcpay-payment-request-wrapper, .wcpay-express-checkout-wrapper, #wcpay-payment-request-wrapper, .wc-stripe-payment-request-wrapper) {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  overflow: visible;
}
body.nzgcd-checkout .woocommerce #payment .woocommerce-privacy-policy-text,
body.nzgcd-checkout .woocommerce #payment .woocommerce-terms-and-conditions-wrapper {
  font-size: 12px;
  line-height: 1.6;
  color: var(--nzgcd-muted);
}

/* Larger displays: classic cart products left, fixed-width summary right. */
@media (min-width: 1024px) {
  body.nzgcd-cart .woocommerce:has(> .woocommerce-cart-form) {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(285px, .85fr);
    align-items: start;
    gap: 20px;
  }
  body.nzgcd-cart .woocommerce > :not(.woocommerce-cart-form):not(.cart-collaterals) {
    grid-column: 1 / -1;
  }
  body.nzgcd-cart .woocommerce > .woocommerce-cart-form { grid-column: 1; }
  body.nzgcd-cart .woocommerce > .cart-collaterals { grid-column: 2; }
  body.nzgcd-checkout .woocommerce form.checkout.woocommerce-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(345px, .85fr);
    grid-template-areas: "customer heading" "customer review";
    align-items: start;
    column-gap: 24px;
    row-gap: 0;
  }
  body.nzgcd-checkout .woocommerce form.checkout #customer_details {
    grid-area: customer;
    width: 100%;
    float: none !important;
  }
  body.nzgcd-checkout .woocommerce form.checkout #order_review_heading {
    grid-area: heading;
    width: 100%;
    float: none !important;
  }
  body.nzgcd-checkout .woocommerce form.checkout #order_review {
    grid-area: review;
  }
}

/* Tablets and phones: no side-by-side columns or float-created empty gaps. */
@media (max-width: 1023px) {
  body.nzgcd-cart .woocommerce > .woocommerce-cart-form { margin-bottom: 16px !important; }
  body.nzgcd-checkout .woocommerce form.checkout #customer_details,
  body.nzgcd-checkout .woocommerce form.checkout #order_review_heading,
  body.nzgcd-checkout .woocommerce form.checkout #order_review {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    max-width: 100%;
  }
}

/* Mobile cart: genuinely compact cards; preserve original working Woo inputs. */
@media (max-width: 767px) {
  body.nzgcd-ui .woocommerce { font-size: 14px; }
  body.nzgcd-cart .woocommerce .woocommerce-cart-form { padding: 11px; }
  body.nzgcd-cart .woocommerce table.shop_table.cart,
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody { display: block; width: 100%; }
  body.nzgcd-cart .woocommerce table.shop_table.cart thead { display: none; }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr:not(.cart_item) {
    display: block !important;
    width: 100%;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr) 28px;
    grid-template-areas: "thumbnail name remove" "thumbnail price price" "thumbnail quantity quantity" "subtotal subtotal subtotal";
    gap: 6px 10px;
    align-items: center;
    margin: 0 0 12px;
    padding: 13px;
    border: 1px solid var(--nzgcd-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.025);
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item > td {
    display: block !important;
    float: none !important;
    width: auto !important;
    min-width: 0;
    border: 0 !important;
    padding: 2px 0 !important;
    margin: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item > td::before { float: none !important; }
  /* Explicit child selector outranks generic tr.cart_item > td display:block.
     Previous v1.0.0 displayed this cell outside the grid, causing the giant
     empty area, the dangling ':' data-title, and generic broken-image icon. */
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item > td.product-thumbnail {
    grid-area: thumbnail;
    display: block !important;
    width: 86px !important;
    min-width: 86px !important;
    height: 102px !important;
    min-height: 102px !important;
    padding: 0 !important;
    background: #e6efe5 url('./listing-golf-ball.jpg') center / cover no-repeat;
    overflow: hidden;
    border-radius: 9px;
    align-self: start;
    position: relative;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item > td.product-thumbnail::before,
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item > td.product-thumbnail::after {
    display: none !important;
    content: none !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail a {
    display: block !important;
    height: 100%;
    width: 100%;
    padding: 0 !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    border-radius: 9px;
    padding: 0;
    margin: 0;
  }
  /* Real product photos are displayed; missing/placeholder thumbnails
     instead reveal the locally packaged golf-ball fallback photograph. */
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail img.woocommerce-placeholder,
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail img[src*="placeholder"] {
    visibility: hidden !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-name {
    grid-area: name;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-name::before { display: none !important; }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-remove {
    grid-area: remove;
    justify-self: end;
    align-self: start;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-remove a.remove {
    width: 28px;
    height: 28px;
    text-align: center;
    font-size: 22px;
    line-height: 28px;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-price {
    grid-area: price;
    color: var(--nzgcd-muted);
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-price::before { content: "Unit price: " !important; font-weight: 600; }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity {
    grid-area: quantity;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity::before { content: "Quantity" !important; font-weight: 650; }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity .quantity {
    float: none !important;
    width: auto !important;
    margin: 0 0 0 auto !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity .qty {
    width: 64px !important;
    max-width: 64px !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-subtotal {
    grid-area: subtotal;
    margin-top: 5px !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--nzgcd-border) !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 750;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-subtotal::before { content: "Subtotal" !important; font-weight: 650; }
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item,
  body.nzgcd-cart .woocommerce table.shop_table.cart tr.cart_item > td:not(.product-thumbnail) {
    min-height: 0 !important;
    height: auto !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tr:not(.cart_item) > td.actions {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 12px !important;
    text-align: left !important;
  }
  body.nzgcd-cart .woocommerce .actions .coupon {
    display: flex !important;
    width: 100% !important;
    float: none !important;
    gap: 8px;
  }
  body.nzgcd-cart .woocommerce .actions .coupon #coupon_code { flex: 1 1 150px; width: 100% !important; }
  body.nzgcd-cart .woocommerce .actions .coupon > button { flex: 0 0 auto; width: auto !important; }
  body.nzgcd-cart .woocommerce .actions > button[name="update_cart"] {
    margin: 10px 0 0;
    width: 100% !important;
  }
  body.nzgcd-cart .woocommerce .cart-collaterals .cart_totals { padding: 17px 13px; }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--nzgcd-border);
  }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr:last-child { border-bottom: 0; }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr > :is(th, td) {
    display: block !important;
    width: auto !important;
    flex: 0 1 auto;
    text-align: right !important;
    border-bottom: 0 !important;
    padding: 11px 6px !important;
  }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr > th { text-align: left !important; }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr > td::before { display: none !important; }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr.order-total { background: #eaf4ed; border-radius: 8px; }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table tr.order-total > :is(th,td) { background: none; }
  body.nzgcd-checkout .woocommerce #customer_details .col-1,
  body.nzgcd-checkout .woocommerce #customer_details .col-2 { padding: 15px !important; }
  body.nzgcd-checkout .woocommerce #order_review { padding: 12px !important; }
  body.nzgcd-checkout .woocommerce #payment { padding: 6px; }
  body.nzgcd-checkout .woocommerce #payment :is(ul.payment_methods, .place-order) { padding: 9px !important; }
  body.nzgcd-checkout .woocommerce table.shop_table tr,
  body.nzgcd-checkout .woocommerce table.shop_table td,
  body.nzgcd-checkout .woocommerce table.shop_table th { overflow-wrap: anywhere; }
  body.nzgcd-checkout .woocommerce #order_review table.shop_table :is(th,td) { padding: 10px 4px; font-size: 13px; }
  body.nzgcd-checkout .woocommerce form .form-row { margin-bottom: 12px !important; }
}

/* ===== v1.0.2 DESKTOP/TABLET CART REPAIR =====
   Use WooCommerce's existing table cells as a responsive product card. Keeping
   all original form fields, cart hooks, quantities and actions untouched avoids
   a second checkout or cart implementation. The original six-column table
   cannot fit inside a narrower sidebar grid alongside the cart summary. */
@media (min-width: 768px) {
  body.nzgcd-cart .woocommerce > .woocommerce-cart-form,
  body.nzgcd-cart .woocommerce .woocommerce-cart-form,
  body.nzgcd-cart .woocommerce > .cart-collaterals,
  body.nzgcd-cart .woocommerce .cart_totals,
  body.nzgcd-cart .woocommerce .woocommerce-cart-form__contents {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart,
  body.nzgcd-cart .woocommerce table.shop_table.cart > tbody {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: separate !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart > thead { display: none !important; }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item {
    display: grid !important;
    grid-template-columns: 94px minmax(0, 1fr) 30px;
    grid-template-areas:
      "nzg-img nzg-name nzg-remove"
      "nzg-img nzg-price nzg-qty"
      "nzg-img nzg-total nzg-total";
    gap: 7px 15px;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 0 14px !important;
    padding: 14px !important;
    border: 1px solid var(--nzgcd-border);
    border-radius: 11px;
    background: #fff;
    align-items: center;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item > td {
    display: block !important;
    box-sizing: border-box !important;
    float: none !important;
    position: static !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 1px 0 !important;
    border: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere;
    vertical-align: middle;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item > td::before {
    display: none !important;
    content: none !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item > td.product-thumbnail {
    grid-area: nzg-img;
    display: block !important;
    width: 94px !important;
    min-width: 94px !important;
    height: 108px !important;
    min-height: 108px !important;
    align-self: start;
    overflow: hidden;
    background: #e6efe5 url('./listing-golf-ball.jpg') center / cover no-repeat;
    border-radius: 9px;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    margin: 0;
    padding: 0;
    border-radius: 9px;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail img.woocommerce-placeholder,
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-thumbnail img[src*="placeholder"] {
    visibility: hidden !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-name {
    grid-area: nzg-name;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-remove {
    grid-area: nzg-remove;
    justify-self: end;
    align-self: start;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-remove .remove {
    display: block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-price {
    grid-area: nzg-price;
    color: var(--nzgcd-muted);
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item > td.product-price::before {
    content: "Unit price: " !important;
    display: inline !important;
    font-weight: 600;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity {
    grid-area: nzg-qty;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    text-align: right !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item > td.product-quantity::before {
    content: "Qty" !important;
    display: inline !important;
    font-weight: 650;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity .quantity {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-quantity .qty {
    width: 65px !important;
    max-width: 65px !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.product-subtotal {
    grid-area: nzg-total;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--nzgcd-border) !important;
    font-weight: 750;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr.cart_item > td.product-subtotal::before {
    content: "Subtotal" !important;
    display: inline !important;
    font-weight: 650;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr:not(.cart_item) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart tbody tr:not(.cart_item) > td.actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 12px !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.actions .coupon {
    display: flex !important;
    align-items: center;
    gap: 8px;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100%;
    flex: 1 1 250px;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.actions #coupon_code {
    float: none !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 125px;
    margin: 0 !important;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.actions .coupon > button {
    flex: 0 0 auto;
    width: auto !important;
    max-width: 100%;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.actions > button[name="update_cart"] {
    float: none !important;
    flex: 0 0 auto;
    display: inline-block;
    width: auto !important;
    max-width: 100%;
    min-width: 110px;
    margin: 0 !important;
  }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table {
    table-layout: fixed;
    width: 100% !important;
  }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table th {
    width: 35%;
    min-width: 0;
    font-weight: 700;
  }
  body.nzgcd-cart .woocommerce .cart_totals table.shop_table td {
    width: 65%;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right !important;
  }
  body.nzgcd-cart .woocommerce .cart_totals .order-total small,
  body.nzgcd-cart .woocommerce .cart_totals .order-total .includes_tax {
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--nzgcd-muted);
    white-space: normal;
  }
  body.nzgcd-cart .woocommerce .cart_totals .wcpay-payment-request-wrapper,
  body.nzgcd-cart .woocommerce .cart_totals .wcpay-express-checkout-wrapper {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
}

/* A narrow desktop/tablet container needs a stack, not squeezed sidebars. */
@media (min-width: 768px) and (max-width: 1179px) {
  body.nzgcd-cart .woocommerce:has(> .woocommerce-cart-form) {
    display: block !important;
  }
  body.nzgcd-cart .woocommerce > .woocommerce-cart-form {
    margin-bottom: 18px !important;
  }
}

/* Narrow cards keep coupon input and buttons legible without overflow. */
@media (min-width: 768px) and (max-width: 1360px) {
  body.nzgcd-cart .woocommerce table.shop_table.cart td.actions .coupon {
    flex-basis: 100%;
  }
  body.nzgcd-cart .woocommerce table.shop_table.cart td.actions > button[name="update_cart"] {
    margin-left: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.nzgcd-ui .woocommerce * { scroll-behavior: auto; transition: none !important; }
}


/* ===== v1.0.3 WooPayments BNPL/Afterpay messaging layout =====
 * WooPayments injects #payment-method-message at priority 5 of
 * woocommerce_proceed_to_checkout, BEFORE the normal checkout button.
 * Stripe renders its contents inside a dynamic iframe, which can need more
 * vertical room when the desktop cart-totals column is narrow. Reserve
 * enough space for the expanded 3-4-line message and "See plans" link,
 * so the CTA and the message never overlap. Does not hide/touch gateways. */
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  clear: both !important;
  width: 100% !important;
  min-width: 0 !important;
}
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout > #payment-method-message {
  position: relative !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 96px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 5px 1px 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout > #payment-method-message iframe {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 90px !important;
  height: 90px !important;
  border: 0 !important;
}
/* Let flex gap, not theme floats/negative margins, control the CTA spacing. */
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout > a.checkout-button {
  float: none !important;
  position: relative !important;
  clear: both !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}
/* Other express payment methods follow checkout in normal DOM order. */
body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout > :is(
  .wcpay-payment-request-wrapper,
  .wcpay-express-checkout-wrapper,
  #wcpay-payment-request-wrapper
) {
  float: none !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}
@media (max-width: 767px) {
  body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout > #payment-method-message {
    min-height: 108px !important;
  }
  body.nzgcd-cart .woocommerce .cart_totals .wc-proceed-to-checkout > #payment-method-message iframe {
    min-height: 102px !important;
    height: 102px !important;
  }
}
