/**
 * PSA Custom Checkout Styles — v3 (Exact Mockup Match)
 * Based on checkout-desktop.html Tailwind mockup
 * Upload to: wp-content/themes/astra-child/woocommerce/checkout/psa-checkout.css
 *
 * Brand Colors (from mockup):
 *   Navy  : #0b2341 / #0c2340
 *   Blue  : #0284c7
 *   Slate : #475569
 *   BG    : #f8fafc
 */

/* ============================================================
   BOX-SIZING
   ============================================================ */
body.woocommerce-checkout *,
body.woocommerce-checkout *::before,
body.woocommerce-checkout *::after {
    box-sizing: border-box !important;
}

/* ============================================================
   PAGE BACKGROUND
   ============================================================ */
body.woocommerce-checkout {
    background: #f8fafc !important;
}

/* ============================================================
   WOOCOMMERCE CONTAINER — let Elementor control layout/width
   We only reset floats and ensure full width within Elementor's grid
   ============================================================ */
body.woocommerce-checkout .woocommerce {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ============================================================
   STEP INDICATOR
   ============================================================ */
body.woocommerce-checkout .psa-checkout-steps {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    padding: 14px 16px !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    margin-bottom: 24px !important;
    font-size: 13px !important;
}
body.woocommerce-checkout .psa-step {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}
body.woocommerce-checkout .psa-step.active { color: #0284c7 !important; }
body.woocommerce-checkout .psa-step.done   { color: #16a34a !important; }
body.woocommerce-checkout .psa-step-num {
    width: 24px !important; height: 24px !important;
    border-radius: 50% !important;
    background: #e2e8f0 !important; color: #64748b !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 12px !important; font-weight: 700 !important; flex-shrink: 0 !important;
}
body.woocommerce-checkout .psa-step.active .psa-step-num { background: #0284c7 !important; color: #fff !important; }
body.woocommerce-checkout .psa-step.done   .psa-step-num { background: #16a34a !important; color: #fff !important; }
body.woocommerce-checkout .psa-step-sep {
    width: 40px !important; height: 2px !important;
    background: #e2e8f0 !important; margin: 0 6px !important; display: inline-block !important;
}

/* ============================================================
   FORM — no grid, Elementor handles columns
   Just remove floats and ensure full width
   ============================================================ */
body.woocommerce-checkout .psa-checkout-wrap,
body.woocommerce-checkout form.woocommerce-checkout {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================================
   REMOVE ALL FLOATS — override WooCommerce & Elementor col2-set rules
   WooCommerce sets #customer_details width:55% float:left
   Elementor sets width:124%
   Both must be killed here with high specificity
   ============================================================ */
body.woocommerce-checkout #customer_details,
body.woocommerce-checkout #customer_details.col2-set,
body.woocommerce-checkout form.woocommerce-checkout #customer_details,
body.woocommerce-checkout form.woocommerce-checkout #customer_details.col2-set,
body.woocommerce-checkout .woocommerce-checkout #customer_details.col2-set,
body.woocommerce-checkout .woocommerce .col2-set,
body.woocommerce-checkout .woocommerce .col2-set .col-1,
body.woocommerce-checkout .woocommerce .col2-set .col-2,
body.woocommerce-checkout #customer_details .col-1,
body.woocommerce-checkout #customer_details .col-2 {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-right: 0 !important;
    clear: none !important;
    box-sizing: border-box !important;
}
/* Kill Elementor woocommerce widget overrides */
.woocommerce-page.woocommerce-checkout #customer_details.col2-set,
.elementor-widget-woocommerce-checkout-page #customer_details.col2-set {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
}
body.woocommerce-checkout #customer_details::before,
body.woocommerce-checkout #customer_details::after,
body.woocommerce-checkout .col2-set::before,
body.woocommerce-checkout .col2-set::after {
    display: none !important; content: none !important;
}

/* ============================================================
   BILLING DETAILS CARD — white card, border, shadow
   Matches: bg-white rounded-xl border border-slate-200 p-6 shadow-sm
   ============================================================ */
body.woocommerce-checkout .woocommerce-billing-fields {
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
    padding: 24px 28px !important;
    margin-bottom: 0 !important;
}

body.woocommerce-checkout .woocommerce-billing-fields h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 20px !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* "Ship to different address" section — card style */
body.woocommerce-checkout .woocommerce-shipping-fields {
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
    padding: 16px 20px !important;
    margin-top: 16px !important;
}

/* Additional fields (order notes) */
body.woocommerce-checkout .woocommerce-additional-fields {
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
    padding: 16px 20px !important;
    margin-top: 16px !important;
}

/* ============================================================
   BILLING FIELDS — 2-col grid
   ============================================================ */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px 16px !important;
}

/* Full-width */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-wide,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_address_1_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_address_2_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_email_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_phone_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_city_field {
    grid-column: 1 / -1 !important;
}

/* Half-width pairs */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_first_name_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_last_name_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_postcode_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_state_field,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper #billing_country_field {
    grid-column: span 1 !important;
}

/* ============================================================
   FORM ROWS & LABELS
   ============================================================ */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    margin: 0 !important; padding: 0 !important;
    float: none !important; width: 100% !important;
}
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper label {
    font-size: 11px !important; font-weight: 600 !important;
    color: #475569 !important; display: block !important;
    margin-bottom: 5px !important; text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper abbr[title="required"] {
    text-decoration: none !important;
    color: #ef4444 !important;
}

/* ============================================================
   INPUTS — matches Tailwind form inputs in mockup
   ============================================================ */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input[type="text"],
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input[type="email"],
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input[type="tel"],
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input[type="number"],
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper select,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper textarea {
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 9px 12px !important;
    font-size: 14px !important;
    color: #0f172a !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    height: auto !important;
    outline: none !important;
    appearance: auto !important;
}
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper input:focus,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper select:focus,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper textarea:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2,132,199,0.15) !important;
    background: #fff !important;
}

/* ============================================================
   PHONE +91 PREFIX
   ============================================================ */
body.woocommerce-checkout #billing_phone_field {
    position: relative !important;
}
body.woocommerce-checkout #billing_phone_field::before {
    content: '+91' !important;
    position: absolute !important;
    left: 12px !important; bottom: 9px !important;
    font-size: 14px !important; color: #64748b !important;
    font-weight: 600 !important; pointer-events: none !important; z-index: 2 !important;
}
body.woocommerce-checkout #billing_phone {
    padding-left: 44px !important;
}

/* ============================================================
   SELECT2
   ============================================================ */
body.woocommerce-checkout .select2-container .select2-selection--single {
    height: 38px !important; border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important; background: #fff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}
body.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important; padding: 0 12px !important;
    font-size: 14px !important; color: #0f172a !important;
}
body.woocommerce-checkout .select2-container .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}

/* ============================================================
   ORDER REVIEW — right column card
   Matches: bg-white rounded-xl border border-slate-200 p-6 shadow-sm
   ============================================================ */
body.woocommerce-checkout .woocommerce-checkout-review-order {
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
    padding: 0 !important;
    overflow: hidden !important;
    margin-bottom: 16px !important;
}
body.woocommerce-checkout #order_review_heading {
    display: none !important;
}

/* Table */
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table {
    width: 100% !important; border-collapse: collapse !important;
    font-size: 13px !important; border: none !important; background: transparent !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table thead th {
    padding: 14px 20px 10px !important; font-size: 10px !important;
    font-weight: 700 !important; text-transform: uppercase !important;
    letter-spacing: 0.07em !important; color: #94a3b8 !important;
    border-bottom: 1px solid #e2e8f0 !important; background: transparent !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table thead th:last-child {
    text-align: right !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tbody td {
    padding: 14px 20px !important; border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: top !important; border-top: none !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table .product-name {
    color: #0f172a !important; font-weight: 700 !important; font-size: 13px !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table .product-total {
    text-align: right !important; color: #0f172a !important;
    font-weight: 600 !important; white-space: nowrap !important;
}
body.woocommerce-checkout .woocommerce-checkout-review-order-table .wc-item-meta,
body.woocommerce-checkout .woocommerce-checkout-review-order-table dl.variation,
body.woocommerce-checkout .woocommerce-checkout-review-order-table .wc-item-meta li {
    font-size: 11px !important; color: #64748b !important; margin: 4px 0 0 !important;
    line-height: 1.6 !important;
}

/* Totals */
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tfoot tr th,
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tfoot tr td {
    padding: 10px 20px !important; font-size: 12px !important;
    color: #475569 !important; border-bottom: 1px solid #f1f5f9 !important; border-top: none !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tfoot td {
    text-align: right !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tfoot .order-total th,
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tfoot .order-total td {
    font-size: 15px !important; font-weight: 700 !important;
    color: #0c2340 !important; padding: 14px 20px !important; border-bottom: none !important;
}
body.woocommerce-checkout .shop_table.woocommerce-checkout-review-order-table tfoot .order-total .woocommerce-Price-amount {
    color: #0284c7 !important; font-size: 17px !important;
}

/* ============================================================
   COUPON BOX
   ============================================================ */
body.woocommerce-checkout .woocommerce-form-coupon-toggle {
    background: #fff !important; border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important; padding: 12px 16px !important;
    margin-bottom: 12px !important; font-size: 12px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}
body.woocommerce-checkout .woocommerce-form-coupon-toggle .showcoupon {
    color: #0284c7 !important; font-weight: 600 !important;
}

/* ============================================================
   PAYMENT BOX — card style
   Matches: bg-white rounded-xl border border-slate-200 p-6 shadow-sm
   ============================================================ */
body.woocommerce-checkout #payment {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07) !important;
    overflow: hidden !important;
    margin-top: 0 !important;
}
body.woocommerce-checkout #payment .wc_payment_methods {
    list-style: none !important; margin: 0 !important; padding: 0 !important;
}
body.woocommerce-checkout #payment .wc_payment_methods li {
    border-bottom: 1px solid #f1f5f9 !important;
}
body.woocommerce-checkout #payment .wc_payment_methods li:last-child {
    border-bottom: none !important;
}
body.woocommerce-checkout #payment .wc_payment_methods label {
    display: flex !important; align-items: center !important;
    gap: 10px !important; padding: 14px 20px !important;
    cursor: pointer !important; font-size: 13px !important;
    font-weight: 600 !important; color: #0f172a !important;
}
body.woocommerce-checkout #payment .wc_payment_methods input[type="radio"] {
    width: 16px !important; height: 16px !important;
    accent-color: #0284c7 !important; flex-shrink: 0 !important;
}
body.woocommerce-checkout #payment .wc_payment_methods label img {
    height: 20px !important; width: auto !important;
    object-fit: contain !important; margin-left: auto !important;
}
body.woocommerce-checkout #payment .payment_box {
    background: #f8fafc !important; border-top: 1px solid #e2e8f0 !important;
    padding: 12px 20px !important; font-size: 11px !important;
    color: #64748b !important; text-align: center !important;
}

/* ============================================================
   PLACE ORDER BUTTON — blue, full width
   Matches: bg-[#0284c7] rounded-lg font-semibold
   ============================================================ */
body.woocommerce-checkout #payment .place-order {
    padding: 16px 20px !important;
}
body.woocommerce-checkout #place_order,
body.woocommerce-checkout button#place_order {
    width: 100% !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 13px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
}
body.woocommerce-checkout #place_order:hover,
body.woocommerce-checkout button#place_order:hover {
    background: #0369a1 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(2,132,199,0.3) !important;
}
body.woocommerce-checkout #place_order:active,
body.woocommerce-checkout button#place_order:active {
    transform: scale(0.99) !important;
}

/* ============================================================
   MOBILE FIXED BOTTOM BAR
   ============================================================ */
body.woocommerce-checkout .psa-fixed-bottom { display: none; }

@media (max-width: 767px) {
    /* Force single column on mobile — override Elementor's 2-col grid */
    body.woocommerce-checkout .e-checkout__container,
    body.woocommerce-checkout .woocommerce-checkout .e-checkout__container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    /* Billing form first, order summary second on mobile */
    body.woocommerce-checkout .e-checkout__column--start {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    body.woocommerce-checkout .e-checkout__column--end {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.woocommerce-checkout .psa-fixed-bottom {
        position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
        z-index: 9999 !important; background: #fff !important;
        border-top: 1px solid #e2e8f0 !important; padding: 12px 16px !important;
        display: flex !important; align-items: center !important; gap: 12px !important;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1) !important;
    }
    body.woocommerce-checkout .psa-fixed-bottom .psa-total-label { flex: 1 !important; }
    body.woocommerce-checkout .psa-fixed-bottom .psa-total-label span {
        display: block !important; font-size: 10px !important; color: #64748b !important;
        text-transform: uppercase !important; letter-spacing: 0.05em !important;
    }
    body.woocommerce-checkout .psa-fixed-bottom .psa-total-label strong {
        font-size: 17px !important; font-weight: 800 !important; color: #0c2340 !important;
    }
    body.psa-mobile-checkout #payment .place-order { display: none !important; }
    body.woocommerce-checkout form.woocommerce-checkout { padding-bottom: 80px !important; }
}

/* ============================================================
   ORDER REVIEW HEADING — hidden everywhere (heading inside card)
   ============================================================ */
body.woocommerce-checkout #order_review_heading { display: none !important; }

/* ============================================================
   VALIDATION & NOTICES
   ============================================================ */
body.woocommerce-checkout .woocommerce-error,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout .woocommerce-info {
    border-radius: 8px !important; font-size: 13px !important;
    margin-bottom: 16px !important; padding: 12px 16px !important;
}

/* ============================================================
   ASTRA OVERRIDES — remove conflicting padding/layout
   ============================================================ */
body.woocommerce-checkout .ast-container,
body.woocommerce-checkout .ast-separate-container .entry-content,
body.woocommerce-checkout .site-content,
body.woocommerce-checkout .content-area {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.woocommerce-checkout .ast-woocommerce-container {
    padding: 0 !important;
}

/* ============================================================
   CLEAR
   ============================================================ */
body.woocommerce-checkout .clear { display: none !important; }
