/* ============================================================================
   USAR WC Bridge — branded checkout + cart styling (v0.7.3)

   Aggressive overrides — uses !important throughout because WC themes and
   block-checkout markup ship higher-specificity defaults that otherwise win.
   Scoped to .woocommerce-cart and .woocommerce-checkout so nothing leaks.
   ============================================================================ */

.woocommerce-cart,
.woocommerce-checkout {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
    color: #1a1a1a !important;
}

/* ============================================================================
   PAGE BACKDROP — soft brand-aware background to lift the form cards
   ============================================================================ */
body.woocommerce-checkout,
body.woocommerce-cart {
    background: #f4f6f9;
}

/* ============================================================================
   HEADINGS — Playfair, larger, gold underline, more presence
   ============================================================================ */
.woocommerce-cart h1,
.woocommerce-cart h2,
.woocommerce-cart h3,
.woocommerce-checkout h1,
.woocommerce-checkout h2,
.woocommerce-checkout h3,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-shipping-fields > h3 {
    font-family: 'Playfair Display', Georgia, serif !important;
    color: #294a70 !important;
    font-weight: 700 !important;
    font-size: 26px !important;
    line-height: 1.25 !important;
    border-bottom: 3px solid #e69b1e !important;
    padding-bottom: 0.4em !important;
    margin: 0 0 1.25em !important;
    letter-spacing: -0.01em;
}
.woocommerce-checkout .woocommerce-billing-fields > h3,
.woocommerce-checkout .woocommerce-shipping-fields > h3 {
    font-size: 24px !important;
}

/* ============================================================================
   HIDE COUPON PROMPT ON CHECKOUT (CSS fallback — PHP also removes it)
   ============================================================================ */
.woocommerce-checkout .woocommerce-form-coupon-toggle,
.woocommerce-checkout form.checkout_coupon,
.woocommerce-checkout .woocommerce-form-coupon {
    display: none !important;
}

/* ============================================================================
   REORDER: SHIPPING FIRST, BILLING SECOND (v0.7.19)
   ============================================================================
   Customer mental model: enter where the ID cards SHIP first, then billing
   defaults to match. WC's default ordering is billing-then-shipping; we
   flip via flex `order`. Native "Ship to a different address?" toggle is
   hidden because shipping is now always rendered up top.

   WC structure:
     #customer_details > .col2-set
       > .col-1 → .woocommerce-billing-fields
       > .col-2 → .woocommerce-shipping-fields  +  .woocommerce-additional-fields

   Hiding `.woocommerce-additional-fields` only (not the whole .col-2)
   keeps shipping visible; flex order puts shipping above billing.
   ============================================================================ */
.woocommerce-checkout #customer_details {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin-bottom: 1.5em !important;
}
.woocommerce-checkout #customer_details .col2-set,
.woocommerce-checkout #customer_details > .col2-set {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}
.woocommerce-checkout #customer_details > .col-1,
.woocommerce-checkout #customer_details .col2-set > .col-1 {
    /* Billing → render SECOND. */
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}
.woocommerce-checkout #customer_details > .col-2,
.woocommerce-checkout #customer_details .col2-set > .col-2 {
    /* Shipping → render FIRST. */
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}
.woocommerce-checkout .woocommerce-additional-fields,
.woocommerce-checkout .usar-hidden-field {
    display: none !important;
}
/* Shipping section: always render. WC's #ship-to-different-address h3
   contains the now-redundant toggle — collapse its label visually but
   keep the h3 (and its sibling .shipping_address container) intact.
   v0.7.20 — zero out the h3's own border/padding/margin so it doesn't
   render a separate gold underline; only the ::after pseudo-element
   carries the heading style now. */
.woocommerce-checkout #ship-to-different-address {
    pointer-events: none;
    border-bottom: 0 !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}
.woocommerce-checkout #ship-to-different-address label,
.woocommerce-checkout #ship-to-different-address input[type="checkbox"] {
    display: none !important;
}
.woocommerce-checkout #ship-to-different-address:after {
    content: "Shipping address";
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    color: #294a70;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.25;
    border-bottom: 3px solid #e69b1e;
    padding-bottom: 0.4em;
    margin: 0 0 1.25em;
    letter-spacing: -0.01em;
}
.woocommerce-checkout .shipping_address {
    display: block !important;
}

/* ============================================================================
   BILLING-SAME-AS-SHIPPING TOGGLE (v0.7.20)
   ============================================================================
   Checkbox checked (default): hide the billing fields wrapper, JS keeps the
   billing inputs synced to shipping in the background so WC validation
   passes. Unchecked: billing fields wrapper re-shows and customer enters
   different billing manually.
   ============================================================================ */
.woocommerce-checkout .usar-wc-same-as-shipping {
    margin: 0 0 1em;
    padding: 12px 14px;
    background: #f0f6fb;
    border-left: 4px solid #294a70;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #1a3354;
}
.woocommerce-checkout .usar-wc-same-as-shipping input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #294a70;
    flex-shrink: 0;
    cursor: pointer;
}
.woocommerce-checkout .usar-wc-same-as-shipping label {
    cursor: pointer;
    font-weight: 600;
    color: #1a3354;
}
.woocommerce-checkout .usar-wc-same-as-shipping label .usar-wc-same-as-shipping-help {
    display: block;
    font-weight: 400;
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}
/* Collapsed state — hide every billing row EXCEPT the email field. Email
   is the contact for order confirmation, magic-link auto-login, and
   renewal reminders, so it has to stay visible regardless of whether the
   customer's credit-card billing address differs from shipping. v0.7.23. */
.woocommerce-checkout.usar-wc-billing-collapsed .woocommerce-billing-fields__field-wrapper > p.form-row {
    display: none !important;
}
.woocommerce-checkout.usar-wc-billing-collapsed .woocommerce-billing-fields__field-wrapper > p#billing_email_field {
    display: block !important;
    flex: 1 1 100% !important;
}
.woocommerce-checkout.usar-wc-billing-collapsed .woocommerce-billing-fields > h3 {
    opacity: 0.6;
}

/* ============================================================================
   BILLING CARD CONTAINER — clean white card with comfortable padding
   ============================================================================ */
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields {
    background: #ffffff !important;
    padding: 2em 2em 1.5em !important;
    border: 1px solid #d8dde3 !important;
    border-radius: 10px !important;
    margin-bottom: 1.25em !important;
    box-shadow: 0 2px 6px rgba(41,74,112,0.04) !important;
}

/* ============================================================================
   FORM FIELD LAYOUT — flexbox row-based, more reliable than grid for WC <p> tags
   ============================================================================ */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 14px 16px !important;
    margin: 0 !important;
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    flex: 1 1 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}
/* First / Last name share a row */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_first_name_field {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: 220px;
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_last_name_field {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: 220px;
}
/* Country = full row but compact */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_country_field {
    flex: 1 1 100% !important;
}
/* Address 1 = full row, Address 2 = full row (apt) */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_address_1_field,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_address_2_field {
    flex: 1 1 100% !important;
}
/* City + State + ZIP — 2/1/1 ratio on one row */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_city_field,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .usar-col-city {
    flex: 2 1 240px !important;
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_state_field,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .usar-col-state {
    flex: 1 1 140px !important;
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_postcode_field,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .usar-col-zip {
    flex: 1 1 110px !important;
}
/* Phone = compact, paired with email if present */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_phone_field {
    flex: 1 1 100% !important;
}
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_email_field {
    flex: 1 1 100% !important;
}

/* ============================================================================
   FORM INPUTS — branded styling
   ============================================================================ */
.woocommerce-cart input[type="text"],
.woocommerce-cart input[type="email"],
.woocommerce-cart input[type="tel"],
.woocommerce-cart input[type="number"],
.woocommerce-cart textarea,
.woocommerce-cart select,
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="number"],
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.woocommerce-checkout .select2-selection,
.woocommerce-checkout .select2-selection--single {
    padding: 12px 14px !important;
    border: 1.5px solid #c0c8d1 !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
    color: #1a1a1a !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 46px !important;
}
.woocommerce-cart input:focus,
.woocommerce-cart textarea:focus,
.woocommerce-cart select:focus,
.woocommerce-checkout input:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout .select2-container--open .select2-selection {
    outline: none !important;
    border-color: #294a70 !important;
    box-shadow: 0 0 0 4px rgba(41,74,112,0.12) !important;
}
.woocommerce-checkout .select2-selection--single {
    line-height: 1.4 !important;
    padding: 0 !important;
}
.woocommerce-checkout .select2-selection__rendered {
    padding: 12px 14px !important;
    line-height: 1.4 !important;
}
.woocommerce-checkout .select2-selection__arrow {
    height: 46px !important;
    top: 0 !important;
    right: 8px !important;
}

/* Labels — comfortable, branded */
.woocommerce-checkout .form-row label,
.woocommerce-cart .form-row label,
.woocommerce-checkout .form-row .woocommerce-input-wrapper {
    display: block !important;
}
.woocommerce-checkout .form-row > label,
.woocommerce-cart .form-row > label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #294a70 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    margin: 0 0 6px !important;
}
.woocommerce-checkout .form-row .required {
    color: #c62828 !important;
    text-decoration: none !important;
}

/* Country "United States (US)" display — make it look like a proper readout */
.woocommerce-checkout #billing_country_field strong {
    display: inline-block;
    padding: 12px 14px;
    background: #f4f6f9;
    border: 1.5px solid #d8dde3;
    border-radius: 6px;
    font-weight: 600;
    color: #1a3354;
    font-size: 15px;
    min-height: 46px;
    line-height: 22px;
    box-sizing: border-box;
}

/* ============================================================================
   "About your membership" banner — make headline pop, refresh styling
   ============================================================================ */
.usar-wc-pathb-disclosure {
    background: linear-gradient(135deg, #ffffff 0%, #f4f6f9 100%) !important;
    border: 1px solid #d8dde3 !important;
    border-left: 6px solid #2e7d32 !important;
    padding: 1.5em 1.75em !important;
    margin: 0 0 1.5em !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(41,74,112,0.04) !important;
}
.usar-wc-pathb-disclosure h3 {
    font-family: 'Playfair Display', Georgia, serif !important;
    color: #294a70 !important;
    font-size: 22px !important;
    margin: 0 0 0.7em !important;
    border-bottom: 0 !important;
    padding: 0 !important;
}
.usar-wc-pathb-disclosure ul {
    margin: 0;
    padding-left: 1.2em;
    list-style: disc;
    font-size: 15px;
    line-height: 1.7;
    color: #1a1a1a;
}
.usar-wc-pathb-disclosure ul li { margin-bottom: 0.3em; }
.usar-wc-pathb-disclosure ul li strong:first-child {
    color: #2e7d32;
    font-size: 17px;
    margin-right: 0.3em;
}

/* ============================================================================
   "Your order" review table
   ============================================================================ */
.woocommerce-checkout .woocommerce-checkout-review-order {
    background: #ffffff !important;
    border: 1px solid #d8dde3 !important;
    border-radius: 10px !important;
    padding: 1.5em !important;
    box-shadow: 0 2px 6px rgba(41,74,112,0.04) !important;
    margin-top: 0 !important;
}
.woocommerce-checkout #order_review_heading {
    margin-top: 0 !important;
}
.woocommerce-checkout-review-order-table {
    width: 100% !important;
    border: 1px solid #d8dde3 !important;
    border-radius: 8px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
}
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 14px !important;
    border-bottom: 1px solid #e6e9ee !important;
    font-size: 15px !important;
    color: #1a1a1a !important;
    background: #ffffff !important;
}
.woocommerce-checkout-review-order-table thead th {
    background: linear-gradient(135deg, #294a70 0%, #1a3354 100%) !important;
    color: #ffffff !important;
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 0 !important;
}
.woocommerce-checkout-review-order-table tfoot .order-total th,
.woocommerce-checkout-review-order-table tfoot .order-total td {
    background: #f4f6f9 !important;
    color: #1a3354 !important;
    font-weight: 700;
    font-size: 18px !important;
    border-top: 3px solid #e69b1e !important;
}

/* ============================================================================
   PLACE ORDER BUTTON
   ============================================================================ */
.woocommerce-checkout #place_order,
.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    background: linear-gradient(135deg, #e69b1e 0%, #cf8a15 100%) !important;
    color: #ffffff !important;
    border: 0 !important;
    padding: 18px 36px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: transform 0.15s, box-shadow 0.15s !important;
    box-shadow: 0 4px 14px rgba(230,155,30,0.35) !important;
    width: 100% !important;
    max-width: 360px !important;
    margin-left: auto !important;
    display: block !important;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif !important;
}
.woocommerce-checkout #place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230,155,30,0.45) !important;
}

/* ============================================================================
   PAYMENT METHODS
   ============================================================================ */
.woocommerce-checkout #payment {
    background: #fafbfd !important;
    border: 1px solid #d8dde3 !important;
    border-radius: 10px !important;
    margin-top: 1.25em !important;
    overflow: hidden;
}
.woocommerce-checkout #payment ul.payment_methods {
    background: transparent !important;
    border-bottom: 1px solid #e6e9ee !important;
    padding: 1.25em 1.5em !important;
    margin: 0 !important;
}
.woocommerce-checkout #payment ul.payment_methods li {
    background: transparent !important;
    padding: 0.5em 0 !important;
    border: 0 !important;
}
.woocommerce-checkout #payment .place-order {
    padding: 1.5em !important;
    background: transparent !important;
}

/* ============================================================================
   NOTICES
   ============================================================================ */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: 6px !important;
    /* v0.7.38 — preserve WC's default padding-left (~3.5em) so the ::before
       checkmark/info/error icon has room. Without this, the icon overlapped
       the first letter of the notice text. */
    padding: 14px 18px 14px 56px !important;
    font-size: 15px !important;
    border-left-width: 6px !important;
    border-left-style: solid !important;
    margin: 0 0 1.5em !important;
    position: relative !important;
}
/* Pull the icon down to vertically align with the text after our padding tweak. */
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    top: 14px !important;
    left: 18px !important;
}
.woocommerce-message { background: #f1f8f1 !important; border-left-color: #2e7d32 !important; color: #1b5e20 !important; }
.woocommerce-info    { background: #f4f6f9 !important; border-left-color: #294a70 !important; color: #1a3354 !important; }
.woocommerce-error   { background: #ffebee !important; border-left-color: #c62828 !important; color: #b71c1c !important; }

/* ============================================================================
   CART CONTENTS TABLE
   ============================================================================ */
.woocommerce-cart-form table.shop_table {
    border: 1px solid #d8dde3 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    box-shadow: 0 2px 6px rgba(41,74,112,0.04) !important;
}
.woocommerce-cart-form table.shop_table th {
    background: linear-gradient(135deg, #294a70 0%, #1a3354 100%) !important;
    color: #ffffff !important;
    font-family: 'Playfair Display', Georgia, serif !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px !important;
    font-size: 14px !important;
}
.woocommerce-cart-form table.shop_table td {
    padding: 16px !important;
    border-bottom: 1px solid #e6e9ee !important;
    font-size: 15px;
    background: #ffffff;
}

/* Cart line item details (Animal / Breed / Handler) */
.woocommerce-cart-form dl.variation,
.woocommerce-checkout-review-order-table dl.variation {
    margin: 10px 0 0 !important;
    padding: 10px 14px !important;
    background: #f4f6f9 !important;
    border-left: 4px solid #294a70 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}
.woocommerce-cart-form dl.variation dt,
.woocommerce-checkout-review-order-table dl.variation dt {
    font-weight: 700 !important;
    color: #294a70 !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    font-size: 11px !important;
    letter-spacing: 0.6px !important;
    float: left;
    clear: left;
    width: 80px;
}
.woocommerce-cart-form dl.variation dd,
.woocommerce-checkout-review-order-table dl.variation dd {
    margin: 0 0 4px 90px !important;
    color: #1a1a1a !important;
}

/* ============================================================================
   MOBILE
   ============================================================================ */
@media (max-width: 768px) {
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
        flex-direction: column;
    }
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
        flex: 1 1 100% !important;
    }
    .woocommerce-checkout #place_order {
        max-width: 100% !important;
    }
    .woocommerce-cart h2,
    .woocommerce-checkout h2,
    .woocommerce-checkout h3 {
        font-size: 22px !important;
    }
}

/* ============================================================================
   MOBILE (v0.7.52) — wholesale stack of two-column layouts to single column
   ============================================================================
   Without these overrides the WC checkout columns sit half-width and the form
   fields get crushed below ~600px wide. Alex confirmed mobile checkout was
   "terrible layout, not mobile friendly" — this set forces every grid/flex
   row to single-column with tap-friendly padding. */
@media (max-width: 768px) {
    /* WC's #customer_details renders two columns (.col-1 + .col-2); stack
       them and let each take full width. */
    .woocommerce-checkout #customer_details {
        display: block !important;
    }
    .woocommerce-checkout #customer_details > .col-1,
    .woocommerce-checkout #customer_details > .col-2 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 18px !important;
        float: none !important;
    }
    /* Every form row to full width regardless of WC's _half / _last classes. */
    .woocommerce-checkout .form-row,
    .woocommerce-checkout .form-row-first,
    .woocommerce-checkout .form-row-last,
    .woocommerce-checkout .form-row-wide {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    /* Inputs/selects tap-friendly height. */
    .woocommerce-checkout input[type="text"],
    .woocommerce-checkout input[type="email"],
    .woocommerce-checkout input[type="tel"],
    .woocommerce-checkout input[type="password"],
    .woocommerce-checkout select,
    .woocommerce-checkout textarea,
    .woocommerce-checkout .select2-selection {
        font-size: 16px !important;  /* prevent iOS zoom-on-focus */
        min-height: 44px !important;
        padding: 11px 13px !important;
    }
    .woocommerce-checkout .select2-selection__rendered {
        line-height: 24px !important;
    }
    /* Order review panel — full width below the customer details. */
    .woocommerce-checkout #order_review,
    .woocommerce-checkout #order_review_heading {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 0 18px !important;
    }
    /* Payment methods accordion — eat the full width and the radio + label
       have plenty of padding so it's easy to tap. */
    .woocommerce-checkout #payment .payment_methods li label {
        display: block !important;
        padding: 10px 4px !important;
    }
    /* Pull the section-heading underline tighter on mobile. */
    .woocommerce-checkout h3#ship-to-different-address,
    .woocommerce-checkout h3 {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }
    /* Place Order button — full-width, tap-friendly. */
    .woocommerce-checkout #place_order {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 17px !important;
        padding: 14px 16px !important;
    }
    /* Notices padding still has the icon room (carried forward from v0.7.38). */
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        padding: 12px 14px 12px 48px !important;
        font-size: 14px !important;
    }
    .woocommerce-message::before,
    .woocommerce-info::before,
    .woocommerce-error::before {
        top: 12px !important;
        left: 14px !important;
    }
    /* ========================================================================
       Cart table on mobile — stack each line into a card with each cell as
       a label-left / value-right flex row.  (v0.7.53 rewrite — v0.7.52's
       data-title ::before was rendering ABOVE the cell content but the
       cells with inline content like "Subtotal $74.99" still printed the
       label inline with their existing markup, producing overlap. Switching
       to flex layout puts the label in a left column and the value in the
       right column so they never collide.)
       ======================================================================== */
    .woocommerce-cart .woocommerce-cart-form table.cart,
    .woocommerce-cart .woocommerce-cart-form table.cart tbody,
    .woocommerce-cart .woocommerce-cart-form table.cart tr,
    .woocommerce-cart .woocommerce-cart-form table.cart td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart thead {
        display: none !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart tr.cart_item {
        background: #fff !important;
        border: 1px solid #d8dde3 !important;
        border-radius: 10px !important;
        padding: 14px !important;
        margin: 0 0 12px !important;
        box-shadow: 0 1px 4px rgba(41,74,112,0.04) !important;
    }
    /* Generic cell: flex row, label left, value right, both aligned to top. */
    .woocommerce-cart .woocommerce-cart-form table.cart td {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 12px !important;
        padding: 8px 0 !important;
        border: none !important;
        border-top: 1px solid #e6e9ee !important;
        text-align: right !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td::before {
        content: attr(data-title) !important;
        flex: 0 0 auto !important;
        text-align: left !important;
        font-weight: 700 !important;
        color: #294a70 !important;
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.4px !important;
        padding-top: 2px !important;
    }
    /* First cell in a card (thumbnail) shouldn't have the top divider. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-thumbnail {
        border-top: 0 !important;
        padding-top: 0 !important;
        justify-content: center !important;
    }
    /* Thumbnail + remove cells render full-width without label. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-thumbnail,
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-remove {
        display: block !important;
        text-align: left !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-remove {
        text-align: right !important;
        padding: 0 0 6px !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-remove::before,
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-thumbnail::before {
        display: none !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-thumbnail img {
        width: 80px !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }
    /* Product name cell — name on its own line, "Edit details" / variation
       details below in their natural flow. Override flex to block for name. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name {
        display: block !important;
        text-align: left !important;
        padding: 10px 0 8px !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name::before {
        display: block !important;
        margin-bottom: 4px !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name a {
        font-weight: 700 !important;
        color: #1a3354 !important;
        font-size: 15px !important;
        line-height: 1.35 !important;
        text-decoration: none !important;
        display: inline-block !important;
        margin-bottom: 4px !important;
    }
    /* Quantity stepper — keep inline with right edge of card. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity {
        font-weight: 700 !important;
        color: #1a3354 !important;
        font-size: 15px !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity .quantity {
        margin: 0 !important;
        display: inline-flex !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity input.qty {
        width: 64px !important;
        min-height: 38px !important;
        text-align: center !important;
        font-size: 15px !important;
    }
    /* v0.7.54 — Some cart rows render the qty cell as a plain text node "1"
       (sold_individually products + add-on lines without steppers). The flex
       row hides the text behind padding if it's too thin; force minimum
       readable width and ensure the text is visible after the label. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity:after {
        content: "";
        flex: 0 0 0;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity {
        gap: 12px !important;
        min-height: 22px !important;
    }
    /* Treat any non-quantity-wrapped text content as the trailing value. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity > * {
        flex: 0 0 auto !important;
    }
    /* When the cell is genuinely empty (no stepper, no plain text — rare,
       but possible for items where WC suppresses qty entirely), hide the
       row so customers don't see a dangling "QUANTITY" label. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-quantity:empty {
        display: none !important;
    }
    /* Subtotal — right-aligned price. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-subtotal {
        font-weight: 700 !important;
        color: #1a3354 !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-subtotal .amount,
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-price .amount {
        font-size: 15px !important;
    }
    /* Variation list (Animal/Breed/Handler) — sits inside td.product-name in
       a tight nav-style block instead of the desktop float layout. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name dl.variation {
        margin: 8px 0 0 !important;
        padding: 8px 10px !important;
        background: #f4f6f9 !important;
        border-left: 3px solid #294a70 !important;
        border-radius: 4px !important;
        font-size: 12px !important;
        line-height: 1.55 !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name dl.variation dt {
        float: none !important;
        width: auto !important;
        font-size: 10.5px !important;
        margin-right: 4px !important;
        display: inline !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name dl.variation dd {
        margin: 0 0 3px !important;
        display: inline !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name dl.variation dd::after {
        content: "";
        display: block;
        height: 0;
    }
    /* "Edit details" link — full-width below variation list, easy tap target. */
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name a.usar-wc-cart-edit-link,
    .woocommerce-cart .woocommerce-cart-form table.cart td.product-name .usar-wc-cart-edit-link {
        display: inline-block !important;
        margin-top: 8px !important;
        padding: 6px 10px !important;
        background: #fff !important;
        border: 1px solid #cf8a15 !important;
        border-radius: 4px !important;
        color: #cf8a15 !important;
        font-size: 12px !important;
        font-weight: 600 !important;
    }
    /* Coupon/update-cart actions row */
    .woocommerce-cart .woocommerce-cart-form table.cart td.actions {
        display: block !important;
        padding: 12px 0 0 !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.actions .coupon {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.actions input[name="coupon_code"] {
        flex: 1 1 100% !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }
    .woocommerce-cart .woocommerce-cart-form table.cart td.actions button {
        flex: 1 1 100% !important;
        padding: 12px 14px !important;
        font-size: 15px !important;
    }

    /* ========================================================================
       Cart totals + collaterals — full width below cart on mobile
       ======================================================================== */
    .woocommerce-cart .cart-collaterals,
    .woocommerce-cart .cart-collaterals .cart_totals,
    .woocommerce-cart .cart-collaterals .shipping_calculator,
    .woocommerce-cart .cart-collaterals .cross-sells {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .woocommerce-cart .cart-collaterals .cart_totals table.shop_table {
        font-size: 14px !important;
    }
    .woocommerce-cart .cart-collaterals .cart_totals table.shop_table th,
    .woocommerce-cart .cart-collaterals .cart_totals table.shop_table td {
        padding: 10px 12px !important;
    }
    .woocommerce-cart .cart-collaterals .wc-proceed-to-checkout {
        padding: 14px 0 0 !important;
    }
    .woocommerce-cart .cart-collaterals .wc-proceed-to-checkout .checkout-button {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px 16px !important;
        font-size: 16px !important;
    }

    /* ========================================================================
       Related products / cross-sells / upsells grids — stack to single
       column with comfortable card width. WC's default at the bottom of
       the cart page renders 4-up which crushes on phones.
       ======================================================================== */
    .woocommerce .cross-sells ul.products,
    .woocommerce .related ul.products,
    .woocommerce .upsells ul.products,
    .woocommerce-cart .cross-sells ul.products,
    .woocommerce-cart .related ul.products,
    .woocommerce-cart .upsells ul.products {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }
    .woocommerce .cross-sells ul.products li.product,
    .woocommerce .related ul.products li.product,
    .woocommerce .upsells ul.products li.product,
    .woocommerce-cart .cross-sells ul.products li.product,
    .woocommerce-cart .related ul.products li.product,
    .woocommerce-cart .upsells ul.products li.product {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 14px !important;
        background: #fff !important;
        border: 1px solid #d8dde3 !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
        clear: both !important;
        text-align: left !important;
    }
    /* Slightly wider viewport — go 2-up. */
    @media (min-width: 480px) {
        .woocommerce .cross-sells ul.products,
        .woocommerce .related ul.products,
        .woocommerce .upsells ul.products,
        .woocommerce-cart .cross-sells ul.products,
        .woocommerce-cart .related ul.products,
        .woocommerce-cart .upsells ul.products {
            grid-template-columns: 1fr 1fr !important;
        }
    }
    .woocommerce .cross-sells ul.products li.product img,
    .woocommerce .related ul.products li.product img,
    .woocommerce .upsells ul.products li.product img,
    .woocommerce-cart .cross-sells ul.products li.product img,
    .woocommerce-cart .related ul.products li.product img,
    .woocommerce-cart .upsells ul.products li.product img {
        margin: 0 auto 8px !important;
        display: block !important;
        max-width: 140px !important;
        height: auto !important;
    }
    .woocommerce .cross-sells ul.products li.product h2,
    .woocommerce .cross-sells ul.products li.product h3,
    .woocommerce .related ul.products li.product h2,
    .woocommerce .related ul.products li.product h3,
    .woocommerce .upsells ul.products li.product h2,
    .woocommerce .upsells ul.products li.product h3 {
        font-size: 15px !important;
        line-height: 1.3 !important;
        margin: 0 0 4px !important;
        border: 0 !important;
        padding: 0 !important;
        text-align: center !important;
    }
    .woocommerce .cross-sells ul.products li.product .price,
    .woocommerce .related ul.products li.product .price,
    .woocommerce .upsells ul.products li.product .price {
        font-size: 14px !important;
        text-align: center !important;
        margin-bottom: 8px !important;
    }
    .woocommerce .cross-sells ul.products li.product a.button,
    .woocommerce .related ul.products li.product a.button,
    .woocommerce .upsells ul.products li.product a.button {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 11px 12px !important;
        font-size: 14px !important;
        margin-top: 4px !important;
    }
    /* Section header on related/cross-sell groupings. */
    .woocommerce-cart .cross-sells > h2,
    .woocommerce .cross-sells > h2,
    .woocommerce .related > h2,
    .woocommerce .upsells > h2 {
        font-size: 20px !important;
        margin: 22px 0 12px !important;
    }

    /* ========================================================================
       CHECKOUT order review table — tighter on mobile so the right-side
       prices don't crowd into the line item names. Reduce padding, shrink
       variation block, hide row hover effects.
       ======================================================================== */
    .woocommerce-checkout .woocommerce-checkout-review-order {
        padding: 14px !important;
    }
    .woocommerce-checkout-review-order-table {
        font-size: 14px !important;
    }
    .woocommerce-checkout-review-order-table th,
    .woocommerce-checkout-review-order-table td {
        padding: 10px 8px !important;
        font-size: 14px !important;
    }
    .woocommerce-checkout-review-order-table thead th {
        font-size: 11px !important;
        padding: 10px 8px !important;
    }
    .woocommerce-checkout-review-order-table tfoot .order-total th,
    .woocommerce-checkout-review-order-table tfoot .order-total td {
        font-size: 16px !important;
        padding: 12px 8px !important;
    }
    .woocommerce-checkout-review-order-table dl.variation {
        margin: 6px 0 0 !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    .woocommerce-checkout-review-order-table dl.variation dt {
        float: none !important;
        width: auto !important;
        display: inline !important;
        font-size: 10.5px !important;
        margin-right: 4px !important;
    }
    .woocommerce-checkout-review-order-table dl.variation dd {
        margin: 0 0 3px !important;
        display: inline !important;
    }
    /* Product-name column shouldn't allow super long words to push price off. */
    .woocommerce-checkout-review-order-table .product-name {
        width: 60% !important;
        word-break: break-word !important;
    }
    .woocommerce-checkout-review-order-table .product-total {
        width: 40% !important;
        text-align: right !important;
        white-space: nowrap !important;
    }
    /* Place Order Pay section padding tweak so the navy gradient button
       isn't crammed against the bottom edge on mobile. */
    .woocommerce-checkout #payment .place-order {
        padding: 1em !important;
    }

    /* ========================================================================
       Custom v0.7.39 "Your selected upgrades" green summary panel — full
       width above totals, comfortable padding on mobile.
       ======================================================================== */
    .usar-wc-cart-upgrade-summary {
        padding: 12px 14px !important;
        margin: 0 0 14px !important;
    }
    .usar-wc-cart-upgrade-summary h4 {
        font-size: 15px !important;
        margin-bottom: 6px !important;
    }
    .usar-wc-cart-upgrade-summary .usar-wc-summary-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        padding: 10px 0 !important;
    }

    /* ========================================================================
       Path B disclosure banner — tighter padding on mobile.
       ======================================================================== */
    .usar-wc-pathb-disclosure {
        padding: 14px 14px !important;
    }
    .usar-wc-pathb-disclosure h3 {
        font-size: 17px !important;
        margin-bottom: 0.5em !important;
    }
    .usar-wc-pathb-disclosure ul {
        font-size: 13.5px !important;
        line-height: 1.55 !important;
    }

    /* v0.7.54 — Cart + checkout pages get extra bottom padding on mobile so
       any third-party social-proof popups ("Brandon H. just registered"
       floats bottom-left at ~80px tall), the persistent cart pill (bottom-
       right), and the site Help-chat button can't sit on top of the totals
       / Place Order button. ~140px clears typical popup + Help bubble. */
    body.woocommerce-cart .site-content,
    body.woocommerce-checkout .site-content,
    body.woocommerce-cart .entry-content,
    body.woocommerce-checkout .entry-content,
    body.woocommerce-cart .woocommerce,
    body.woocommerce-checkout .woocommerce {
        padding-bottom: 140px !important;
    }
    /* Belt-and-suspenders — push the floating proof widget (if it injects
       its own fixed positioning) above the cart totals so it can't visually
       fight with the order summary card. We can't reliably target a
       third-party class name, so push everything WC renders inside the
       cart to a lower z-index than fixed-position UI elements. */
    body.woocommerce-cart .cart-collaterals,
    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-checkout #order_review {
        position: relative;
        z-index: 1;
    }
}
