/* The storefront checkout uses the same surfaces and controls as the home page. */
body .jd-home-offers .jd-offer-carousel .price:has(> del):has(> ins) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
}

body .jd-home-offers .jd-offer-carousel .price > :is(del, ins) {
    grid-column: 1;
    white-space: nowrap;
}

.jd-commerce-dialog {
    box-sizing: border-box;
    width: min(calc(100% - 32px), 410px);
    max-height: calc(100dvh - 26px);
    padding: 0;
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius-xl, 24px);
    background: var(--jd-bg);
    color: var(--jd-text);
    font-family: var(--jd-font);
    box-shadow: var(--jd-glass-shadow);
    direction: rtl;
}

.jd-commerce-dialog::backdrop { background: rgba(9, 28, 37, .62); }
.jd-commerce-dialog-body { position: relative; padding: 30px 24px 24px; }
.jd-commerce-dialog h2 { margin: 0 0 12px; font-size: clamp(21px, 4vw, 26px); }
.jd-commerce-dialog p { margin: 0 0 14px; color: var(--jd-muted); }
.jd-commerce-dialog-close { position: absolute; inset-block-start: 9px; inset-inline-end: 9px; }
.jd-commerce-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.jd-commerce-dialog-actions > * { flex: 1 1 135px; min-height: 44px; text-align: center; }
.jd-commerce-dialog label { display: block; font-weight: 700; margin-block-end: 6px; }
.jd-commerce-dialog input { width: 100%; min-height: 48px; text-align: center; font-size: 21px; letter-spacing: .2em; }
.jd-commerce-dialog-status { min-height: 1.8em; font-size: 13px; margin-block-start: 8px !important; }
.jd-cart-dialog .jd-commerce-dialog-body { text-align: center; }
.jd-cart-dialog-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-block-end: 13px;
    border-radius: 16px;
    color: var(--jd-success);
    background: var(--jd-surface);
}

body.woocommerce-checkout:not(.jd-order-received) form.checkout #customer_details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 3vw, 30px);
    align-items: start;
    direction: rtl;
}

body.woocommerce-checkout form.checkout #customer_details::before,
body.woocommerce-checkout form.checkout #customer_details::after { display: none; }
body.woocommerce-checkout:not(.jd-order-received) form.checkout #customer_details > :is(.col-1, .col-2) {
    min-width: 0;
    width: 100% !important;
    float: none !important;
    padding: clamp(16px, 2.8vw, 28px);
    border: 1px solid var(--jd-line);
    border-radius: var(--jd-radius-lg, 20px);
    background: var(--jd-glass-soft);
    box-shadow: var(--jd-glass-shadow-sm);
}

body.woocommerce-checkout form.checkout #customer_details :is(.woocommerce-billing-fields, .woocommerce-additional-fields) h3 {
    font-size: clamp(20px, 2.8vw, 25px);
    margin-block: 0 19px;
}

body.woocommerce-checkout form.checkout .woocommerce-billing-fields__field-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 13px;
}

body.woocommerce-checkout form.checkout .woocommerce-billing-fields__field-wrapper > p {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.woocommerce-checkout form.checkout .woocommerce-billing-fields__field-wrapper > :is(#billing_first_name_field, #billing_last_name_field, #billing_state_field, #billing_city_field) {
    grid-column: auto;
}

body.woocommerce-checkout form.checkout #customer_details .form-row label { font-size: 14px; font-weight: 700; margin-block-end: 5px; }
body.woocommerce-checkout form.checkout #customer_details .form-row :is(.input-text, select, .select2-selection) {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    color: var(--jd-text);
    background: var(--jd-glass-strong);
    border: 1px solid var(--jd-line);
    border-radius: 12px;
}

body.woocommerce-checkout form.checkout #customer_details .form-row textarea { min-height: 105px; }
body.woocommerce-checkout form.checkout .select2-container .select2-selection--single .select2-selection__rendered { line-height: 46px; color: var(--jd-text); }
body.woocommerce-checkout form.checkout .select2-container .select2-selection--single .select2-selection__arrow { height: 46px; }
body.woocommerce-checkout #payment .jd-checkout-terms,
body.woocommerce-checkout #payment .jd-checkout-sms-note { font-size: 13px; line-height: 1.85; margin-block: 0 8px; }
body.woocommerce-checkout #payment .jd-checkout-terms a { color: var(--jd-action); font-weight: 800; }
body.woocommerce-checkout #payment .jd-checkout-sms-note { color: var(--jd-muted); }
.jd-checkout-missing { color: var(--jd-error); font-size: 13px; }

@media (max-width: 800px) {
    body.woocommerce-checkout:not(.jd-order-received) form.checkout #customer_details { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 390px) {
    body.woocommerce-checkout form.checkout .woocommerce-billing-fields__field-wrapper { grid-template-columns: minmax(0, 1fr); }
}
