/* WC Smart Cart & Checkout v1.4.0 */

/* Cart: keep WooCommerce's native update action available to JS, but never show it. */
.woocommerce-cart-form .wcscc-hidden-update-cart,
.woocommerce-cart-form button[name="update_cart"].wcscc-hidden-update-cart,
.woocommerce-cart-form input[name="update_cart"].wcscc-hidden-update-cart {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Checkout product row: image, name and quantity stay aligned as one unit. */
.woocommerce-checkout-review-order-table td.product-name {
    vertical-align: middle !important;
}

.woocommerce-checkout-review-order-table .wcscc-checkout-product {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    vertical-align: middle !important;
}

.woocommerce-checkout-review-order-table .wcscc-checkout-thumb {
    width: 64px !important;
    height: 74px !important;
    min-width: 64px !important;
    margin: 0 !important;
    object-fit: contain !important;
    border-radius: 2px !important;
    display: block !important;
}

.woocommerce-checkout-review-order-table .wcscc-checkout-product-info {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    width: 100% !important;
}

.woocommerce-checkout-review-order-table .wcscc-checkout-product-name {
    min-width: 0 !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere !important;
}

.woocommerce-checkout-review-order-table .wcscc-checkout-qty {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
    font-size: 0.95em !important;
    font-weight: 500 !important;
    opacity: 0.86 !important;
    text-align: center !important;
}

/* The native WooCommerce shipping row stays active for calculations but is hidden,
   because the customer-facing Shipment selector now lives under the Phone field. */
.woocommerce-checkout-review-order-table tr.woocommerce-shipping-totals.shipping,
.woocommerce-checkout-review-order-table tr.shipping.woocommerce-shipping-totals,
.woocommerce-checkout-review-order-table tr.wcscc-shipment-selector-row {
    display: none !important;
}

/* Shipment selector under billing Phone. */
.woocommerce-checkout .wcscc-shipment-selector-block {
    width: 100% !important;
    max-width: 100% !important;
    margin: 22px 0 6px !important;
    clear: both !important;
}

.woocommerce-checkout .wcscc-shipment-heading {
    display: block !important;
    margin: 0 0 9px !important;
}

.woocommerce-checkout .wcscc-shipment-heading label {
    display: inline-block !important;
    margin: 0 !important;
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
}

.woocommerce-checkout .wcscc-shipment-heading .required {
    color: #e2401c !important;
    text-decoration: none !important;
}

.woocommerce-checkout .wcscc-shipment-options {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #dedede !important;
    background: #fff !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .wcscc-shipment-option {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 20px !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    border: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    line-height: 1.45 !important;
    background: #fff !important;
    transition: background-color .15s ease, box-shadow .15s ease !important;
}

.woocommerce-checkout .wcscc-shipment-option + .wcscc-shipment-option {
    border-top: 1px solid #e7e7e7 !important;
}

.woocommerce-checkout .wcscc-shipment-option:hover,
.woocommerce-checkout .wcscc-shipment-option.is-selected {
    background: #fafafa !important;
}

.woocommerce-checkout .wcscc-shipment-copy {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
}

.woocommerce-checkout .wcscc-shipment-area {
    min-width: 0 !important;
    font-weight: 400 !important;
}

.woocommerce-checkout .wcscc-shipment-price,
.woocommerce-checkout .wcscc-shipment-price .woocommerce-Price-amount,
.woocommerce-checkout .wcscc-shipment-price .amount {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-weight: 700 !important;
}

.woocommerce-checkout .wcscc-shipment-option input[type="radio"] {
    appearance: auto !important;
    -webkit-appearance: radio !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    accent-color: #1689e6;
}

/* Delivery Area must never appear as a dropdown/form field. */
.woocommerce-checkout #delivery_area_field,
.woocommerce-checkout #billing_delivery_area_field,
.woocommerce-checkout #shipping_delivery_area_field,
.woocommerce-checkout [id*="delivery-area"][id$="_field"],
.woocommerce-checkout [id*="delivery_area"][id$="_field"],
.woocommerce-checkout select[name="delivery_area"],
.woocommerce-checkout select[name="billing_delivery_area"],
.woocommerce-checkout select[name="shipping_delivery_area"],
.woocommerce-checkout select[name*="delivery_area"],
.woocommerce-checkout select[name*="delivery-area"] {
    display: none !important;
}

/* Visual feedback while totals are recalculated. */
.woocommerce-cart-form tr.wcscc-updating,
.woocommerce .cart_totals.wcscc-updating,
.wcscc-shipment-selector-block.wcscc-updating {
    opacity: .58;
    transition: opacity .15s ease;
}

@media (max-width: 767px) {
    .woocommerce-checkout-review-order-table .wcscc-checkout-product {
        grid-template-columns: 52px minmax(0, 1fr) !important;
        gap: 9px !important;
    }

    .woocommerce-checkout-review-order-table .wcscc-checkout-thumb {
        width: 52px !important;
        height: 62px !important;
        min-width: 52px !important;
    }

    .woocommerce-checkout-review-order-table .wcscc-checkout-product-info {
        gap: 7px !important;
    }

    .woocommerce-checkout-review-order-table .wcscc-checkout-qty {
        min-width: 28px !important;
        font-size: 0.9em !important;
    }

    .woocommerce-checkout .wcscc-shipment-selector-block {
        margin-top: 18px !important;
    }

    .woocommerce-checkout .wcscc-shipment-option {
        min-height: 52px !important;
        padding: 10px 13px !important;
    }
}
