/* ============================================================
   CHECKOUT: GLOBAL STYLE
   ============================================================ */

/* --- 1. GLOBAL STRUCTURE --- */
body.woocommerce-checkout form.woocommerce-checkout {
    background-color: #F5F5F5;
    border-radius: 12px;
    padding: 20px 10px;
}

/* --- 2. SECTION TITLES --- */
body.woocommerce-checkout #customer_details h3, 
body.woocommerce-checkout #order_review_heading {
    font-size: 24px !important; /* Compact display */
    letter-spacing: 1px;
    border-bottom: 2px solid var(--global-palette1); /* Kadence primary brand color */
    padding-bottom: 2px;
    margin-bottom: 20px !important;
    color: var(--global-palette3);
}

/* --- 3. FORM BLOCKS (LEFT COLUMN) --- */
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper, 
body.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper {
    background: #ffffff;
    padding: 15px !important;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* --- 4. INPUT FIELDS & LABELS --- */
body.woocommerce-checkout label {
    font-size: 13px !important;
    font-weight: 600 !important;
}

body.woocommerce-checkout .form-row {
    margin-bottom: 10px !important; /* Reduces vertical gap between fields */
}

/* Standard Inputs (Text, Select, Textarea) */
body.woocommerce-checkout input[type="text"], 
body.woocommerce-checkout input[type="email"], 
body.woocommerce-checkout input[type="tel"], 
body.woocommerce-checkout textarea, 
body.woocommerce-checkout select,
body.woocommerce-checkout .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    height: auto !important;
    font-size: 14px !important;
    
    /* OPTIMIZATION: Targeted transitions instead of 'all' for better render performance */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Input Focus States */
body.woocommerce-checkout input:focus, 
body.woocommerce-checkout textarea:focus {
    border-color: var(--global-palette1) !important;
    box-shadow: 0 0 0 3px rgba(135, 4, 4, 0.1) !important;
    outline: none;
}

/* --- 5. COUNTRY SELECTOR STYLE (SELECT2) --- */
body.woocommerce-checkout .select2-container--default .select2-selection--single {
    height: 40px !important;
    display: flex;
    align-items: center;
}

body.woocommerce-checkout .select2-dropdown {
    border: 0 0 0 1px solid #e2e8f0 !important;
    margin-top: 0 !important;
    border-radius: 0 0 15px 15px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    z-index: 666;
}

body.woocommerce-checkout .select2-search--dropdown {
    display: none !important; /* Hides the search box inside the dropdown */
}

body.woocommerce-checkout .select2-results__options {
    border: 1px solid #e2e8f0 !important;
    border-radius: 15px !important;
    font-size: 14px !important;
    z-index: 999;
}

/* --- 6. ORDER REVIEW (RIGHT COLUMN) --- */
body.woocommerce-checkout #order_review {
    background: #ffffff !important;
    padding: 14px !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table th, 
body.woocommerce-checkout .woocommerce-checkout-review-order-table td {
    padding: 8px 0 !important;
    font-size: 13px !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name {
    font-weight: 600;
    color: var(--global-palette3);
}

/* --- 7. DIVIDERS (Shipping & Totals) --- */

/* Shipping Block */
body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .woocommerce-shipping-totals th,
body.woocommerce-checkout .woocommerce-checkout-review-order-table tfoot .woocommerce-shipping-totals td {
    padding-top: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid !important; /* Uses currentColor by default */
}

/* Final Totals (Subtotal/Total) */
body.woocommerce-checkout .order-total {
    border-bottom: 2px solid !important;
}

body.woocommerce-checkout .order-total th, 
body.woocommerce-checkout .order-total td {
    border: none !important; 
}

body.woocommerce-checkout .order-total bdi {
    font-size: 18px !important; /* Emphasized size */
    color: var(--global-palette1);
}

/* --- 8. PAYMENT METHODS (Rounded Cards) --- */

/* Main wrapper for each payment method */
body.woocommerce-checkout #payment ul.wc_payment_methods li.wc_payment_method {
    margin-bottom: 8px !important;
}

/* Visual cue when selected */
body.woocommerce-checkout #payment ul.wc_payment_methods li.wc_payment_method input:checked + label {
    color: var(--global-palette1) !important;
}

/* Label styling */
body.woocommerce-checkout #payment ul.wc_payment_methods li.wc_payment_method > label {
    border-radius: 5px !important;
}

/* Payment description box */
body.woocommerce-checkout #payment ul.wc_payment_methods li.wc_payment_method .payment_box {
    margin-top: 6px;
    margin-bottom: 8px;
    border: 1px dotted #e2e8f0 !important;
    border-radius: 5px !important;
    padding: 8px;
    font-size: 12px !important;
    background: #ffffff !important;
}

/* --- 9. PAYMENT & LEGAL (Bottom Blocks) --- */

/* Global Payment Container */
body.woocommerce-checkout .woocommerce-checkout-payment {
    border-radius: 10px;
    padding: 0 15px 0 15px !important;
}

/* Terms and Conditions Block */
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
    margin-top: 20px !important;
    padding: 10px !important;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 12px !important;
}

body.woocommerce-checkout .woocommerce-privacy-policy-text p {
    margin-bottom: 10px !important;
}

/* Final separator before the submit button */
body.woocommerce-checkout .place-order {
    margin-top: 25px !important;
    border-top: 1px dotted #cbd5e1 !important;
}

/* --- 10. FINAL BUTTON (Place Order) --- */
body.woocommerce-checkout #place_order {
    width: 100%;
    background-color: var(--global-palette1) !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 14px !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 12px rgba(135, 4, 4, 0.3) !important;
    
    /* OPTIMIZATION: Specific transitions and hardware acceleration */
    transition: background-color 0.3s ease, transform 0.3s ease !important;
    will-change: transform, background-color;
}

body.woocommerce-checkout #place_order:hover {
    background-color: #008F02 !important; /* Green success state */
    transform: translateY(-2px);
}


/* =========================================================
   CHECKOUT: LOGIN TOGGLE CENTER + BUTTON STYLE
   ========================================================= */

/* "Registered customer?" toggle area */
.woocommerce-checkout .woocommerce-form-login-toggle {
    width: 100%;
    text-align: center;
    display: block;
    margin-bottom: 20px;
}

/* Info block styling (alignment + removes default Woo styling) */
.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    color: #333 !important;
    display: inline-block !important;
}

/* Removes the default WooCommerce info icon (i) */
.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info::before {
    display: none !important;
}

/* "Click here to log in" link styled as a pill button */
.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info a.showlogin {
    display: block;
    margin: 0 auto 0 auto;
    background-color: #242424;
    color: #fff !important;
    padding: 8px 14px;
    border-radius: 40px;
    font-size: 10px;
    text-decoration: none !important;
    text-transform: uppercase;
    font-weight: bold;
    width: fit-content;
    
    /* OPTIMIZATION: Specific transition */
    transition: background-color 0.3s ease;
}

/* Hover state for the login toggle button */
.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info a.showlogin:hover {
    background-color: #444;
}