/* Ticket 310 item 8: cart and checkout (Warren's brief, 28.10.2026).
   Loaded on the cart and checkout pages, after checkout-improvements.css. */

/* 8.2 Coupon bar on the cart page, styled like the points bars above it (values taken from
   the "Complete your order and earn ... Points" bar). */
.woocommerce-cart .glx-cart-coupon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 8px 0 20px;
    padding: 12px 16px;
    background: #f0f4ff;
    border: 1px solid #d0d9ef;
    border-radius: 10px;
    color: #444;
    font-size: 13px;
    line-height: 1.5;
}
/* Until (or unless) the coupon field has been moved in, keep the bar out of sight. */
.woocommerce-cart .glx-cart-coupon:has(.glx-cart-coupon__slot:empty) {
    display: none;
}
.woocommerce-cart .glx-cart-coupon__label {
    font-weight: 600;
}
.woocommerce-cart .glx-cart-coupon .coupon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    float: none;
    margin: 0;
    padding: 0;
}
.woocommerce-cart .glx-cart-coupon .coupon #coupon_code {
    width: 200px;
    max-width: 100%;
    margin: 0;
}

/* 8.5.3 Line amounts right-aligned, flush with the subtotal and total. */
.glx-section-summary .woocommerce-checkout-review-order-table th.product-total,
.glx-section-summary .woocommerce-checkout-review-order-table td.product-total {
    text-align: right;
    white-space: nowrap;
    padding-left: 12px;
}

/* 8.5.4, 8.5.5 Shipping: one full-width cell under "Your Shipping Selection", so the
   free-shipping block and the chosen method use the whole summary width. */
.glx-section-summary .woocommerce-shipping-totals.glx-shipping-totals--summary {
    display: table-row;
}
.glx-section-summary .woocommerce-shipping-totals.glx-shipping-totals--summary > td {
    display: table-cell;
    width: auto;
    padding: 12px 0;
    text-align: left;
}
.glx-section-summary .glx-shipping-summary-title {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}
.glx-section-summary .glx-shipping-totals--summary .glx-shipping-bar,
.glx-section-summary .glx-shipping-totals--summary .woocommerce-shipping-methods,
.glx-section-summary .glx-shipping-totals--summary .glx-ship-panel__list,
.glx-section-summary .glx-shipping-totals--summary .glx-ship-option--selected {
    width: 100%;
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
}

/* 8.5.6 "(includes R... VAT)" on one line. */
#page-container .glx-section-summary .order-total .includes_tax {
    white-space: nowrap !important;
}

/* 8.6 Bigger terms tick-box and text. */
.glx-place-order-wrap .glx-terms-row {
    align-items: center;
    gap: 10px;
    font-size: 15px;
    line-height: 1.4;
}
.glx-place-order-wrap .glx-terms-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    flex: none;
    cursor: pointer;
}
.glx-place-order-wrap .glx-terms-row label {
    cursor: pointer;
}

/* Centre the cart and checkout (Warren, 02.11.2026). Divi's site-wide default is a right
   sidebar, so these pages kept the left 77% of the width and the sidebar divider line,
   though they have no sidebar. */
body.woocommerce-cart.et_right_sidebar #left-area,
body.woocommerce-checkout.et_right_sidebar #left-area {
    float: none;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding-right: 0;
}
body.woocommerce-cart.et_right_sidebar #main-content .container::before,
body.woocommerce-checkout.et_right_sidebar #main-content .container::before {
    display: none;
}

/* The hidden province select behind the Select2 box was stretched to the container width
   and pushed the checkout wider than the screen (a horizontal scrollbar). The theme sizes
   form selects at 100% with !important, so this needs the longer selector to win. */
body.woocommerce-checkout form.checkout .form-row select.select2-hidden-accessible {
    width: 1px !important;
}

/* Line up the bottoms of the two checkout columns (Warren, 02.11.2026). The order summary is
   sticky, so it stops at the bottom of the grid, which sat 14px below the Payment box because
   of that box's bottom margin. Desktop only: below 981px the columns stack. */
@media (min-width: 981px) {
    .glx-checkout-main > .glx-section:last-child {
        margin-bottom: 0;
    }
    .glx-checkout-layout {
        margin-bottom: 14px;
    }
}
