/*
Theme Name: Divi Child
Theme URI: https://diviextended.com/
Version: 1.0
Description: Child Theme of Divi
Author: Divi Extended
Template: Divi
*/
@import url("../Divi/style.css");

/* ============================================
   LOADER STYLES
   ============================================ */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   COURSE SELECTION MODULE
   ============================================ */
#category-product-selection {
    background-color: #fff;
    border: none;
    border-radius: 10px;
    text-align: center !important;
    padding: 10px;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.2);
}

#category-product-selection label {
    font-weight: bold;
    display: block;
    margin: 10px 30;
    border: none;
    border-radius: 10px;
    padding: 10px 30px;
    color: #000;
    background-color: #e3ddd6;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    margin-right: 10px;
    width: 232px;
    font-size: 17px;
}

input[type="radio"] {
    display: none;
}

#country-selection ul li,
#category-selection ul li {
    margin: 0 10px;
    padding-bottom: 10px;
    list-style: none;
}

selection ul {
    list-style: none !important;
}

.category-dropdown label,
#product-selection label {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Checkout button styling */
#checkout-button-container {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#checkout-button {
    background-color: #800000;
    color: white;
    font-size: 24px;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
}

#checkout-button:hover {
    background-color: #a00000;
}

#checkout-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

#country-selection label.checked,
#category-selection label.checked {
    background-color: #03A0A8;
    color: #fff;
}

#product-selection span {
    font-size: medium;
    padding: 5px 0px;
    color: #333333;
    display: grid;
    font-size: 20px;
    display: block !important;
}

.zl-loader {
    display: none;
    margin-left: 47px;
    vertical-align: middle;
    margin-bottom: -18px !important;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(0, 0, 0, .1);
    border-top: 4px solid #000;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin .6s linear infinite;
}

.cs_course_location {
    font-size: 14px !important;
    font-style: italic;
    font-weight: 700;
    display: flex;
}

.zl-w-50 {
    width: 50%;
}

.location_cs {
    padding: 10px 0px;
}

.location_cs strong {
    font-style: italic;
    font-weight: 700;
}

.location_product {
    display: flex;
    font-size: 16px;
    padding: 20px;
    padding-top: 10px;
    margin-right: 30px;
    background: #f1f1f1;
    margin-top: 15px;
    border-radius: 8px;
}

#product-selection select {
    width: 50% !important;
}

.select-spinner {
    position: absolute;
    top: 70%;
    left: 85%;
    transform: translate(-50%, -50%);
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #000;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin 0.6s linear infinite;
    display: none;
}

.unit_spinner {
    left: 45% !important;
    top: 65% !important;
}

select {
    padding: 10px;
    border-radius: 15px;
    border: 2px solid black;
    font-size: 18px;
}

#all-categories-dropdowns {
    padding: 10px 20px;
}

#all-categories-dropdowns select {
    padding: 10px;
    border-radius: 15px;
    border: 2px solid black;
    font-size: 18px;
}

.select-spinner-wrapper {
    position: relative;
    text-align: left;
}

#country-selection h5,
#category-selection h5 {
    text-align: left !important;
    padding-left: 23px;
}

/* ============================================
   CHECKOUT PAGE STYLES
   ============================================ */
.zl-currency-switcher-wrapper > div {
    width: 49%;
}

.zl-currency-switcher-wrapper {
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.zl-currency-description {
    font-style: italic;
}

.zl_custom_woo_shortcode h3#order_review_heading {
    display: none;
}

.zl_custom_woo_shortcode .select2-container .select2-selection {
    background-color: #eee;
    max-width: 100%;
    border-width: 0;
    border-radius: 0;
    color: #999;
    font-size: 14px;
    padding: 16px;
    line-height: 1.7em;
}

.woocommerce-page button.button.alt:after {
    opacity: 1;
    position: unset;
    content: "\52";
    margin-left: 13px;
    font-size: 24px;
}

.zl_custom_woo_shortcode button#place_order {
    color: #FFFFFF !important;
    border-color: #000000;
    border-radius: 11px;
    font-size: 23px;
    font-family: 'Exo 2', Helvetica, Arial, Lucida, sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    padding-right: 1em;
    padding-left: 0.7em;
    float: left !important;
    background-color: #c91e1e;
    margin-top: 20px !important;
}

.zl_payment_form li label {
    cursor: pointer;
}

.payment_box.payment_method_bacs {
    background: #fff !important;
    padding: 0px !important;
}

div#payment {
    background-color: #f5f5f5 !important;
    padding: 10px;
    margin-top: 60px !important;
}

.payment_box.payment_method_woocommerce_payments {
    padding: 0px !important;
    background-color: #fff !important;
    margin: 0px !important;
}

.wc_payment_methods.payment_methods.methods label {
    font-family: 'Exo 2', Helvetica, Arial, Lucida, sans-serif;
    font-weight: 700;
    font-size: 19px;
    cursor: pointer;
}

.woocommerce-checkout #payment div.payment_box::before {
    display: none;
}

.zl_payment_form li.wc_payment_method,
li.wc_payment_method {
    border-radius: 5px;
    padding: 15px !important;
    background: #fff !important;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
    margin: 0px 0px 20px 0px !important;
}

.zl_payment_form .payment_box.payment_method_bacs {
    padding: 0px !important;
}

.zl_payment_form .form-row.place-order {
    margin-top: 10px !important;
}

.zl_payment_form button#place_order {
    float: left !important;
}

.zl_payment_form .payment_box.payment_method_woocommerce_payments {
    padding: 0px 5px 0px 5px !important;
    margin-bottom: 0px !important;
}

.zl_payment_form fieldset#wc-woocommerce_payments-upe-form {
    padding: 0px !important;
}

/* Admin */
.options_group span.woocommerce-help-tip {
    margin-left: -15px !important;
}

/* ============================================
   HIDE RETURNING CUSTOMER LOGIN TOGGLE
   ============================================ */
.woocommerce-form-login-toggle {
    display: none !important;
}

/* ============================================
   CHECKOUT FORM FIELDS - FIXED LAYOUT
   Using flexbox to control both ORDER and WIDTH
   High specificity for Divi theme override
   ============================================ */

/* Main field wrapper - MUST be flex for order to work */
/* Multiple selectors for different WooCommerce/Divi configurations */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.woocommerce form.checkout .woocommerce-billing-fields__field-wrapper,
body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.et_pb_module .woocommerce-billing-fields__field-wrapper,
.woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 20px !important;
    margin: 0 !important;
    width: 100% !important;
}

/* All form rows default to full width */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > p,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper > p.form-row {
    width: 100% !important;
    flex: 0 0 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 15px !important;
    max-width: 100% !important;
}

/* First Name - Half width, ordered first */
p#billing_first_name_field,
.woocommerce-checkout p#billing_first_name_field,
.woocommerce-billing-fields__field-wrapper p#billing_first_name_field {
    width: calc(50% - 10px) !important;
    flex: 0 0 calc(50% - 10px) !important;
    max-width: calc(50% - 10px) !important;
    order: 1 !important;
}

/* Last Name - Half width, ordered second (same row as first) */
p#billing_last_name_field,
.woocommerce-checkout p#billing_last_name_field,
.woocommerce-billing-fields__field-wrapper p#billing_last_name_field {
    width: calc(50% - 10px) !important;
    flex: 0 0 calc(50% - 10px) !important;
    max-width: calc(50% - 10px) !important;
    order: 2 !important;
}

/* Email - Full width, ordered third */
p#billing_email_field,
.woocommerce-checkout p#billing_email_field {
    order: 3 !important;
    width: 100% !important;
    flex: 0 0 100% !important;
}

/* Confirm Email - Full width, ordered fourth (right after email) */
p#billing_email_confirm_field,
.woocommerce-checkout p#billing_email_confirm_field,
.tcv-confirm-email-row {
    order: 4 !important;
    width: 100% !important;
    flex: 0 0 100% !important;
}

/* Phone - Full width, ordered fifth */
p#billing_phone_field,
.woocommerce-checkout p#billing_phone_field {
    order: 5 !important;
}

/* Address fields ordering */
p#billing_address_1_field { order: 6 !important; }
p#billing_address_2_field { order: 7 !important; }
p#billing_city_field { order: 8 !important; }
p#billing_postcode_field { order: 9 !important; }
p#billing_state_field { order: 10 !important; }
p#billing_country_field { order: 11 !important; }

/* Verification section - ordered before everything */
#tcv-verification-wrapper {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 30px !important;
    order: 0 !important;
}

/* Style checkout inputs to match theme */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    background: #f1f1f1 !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    width: 100% !important;
}

.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus {
    border-color: #03A0A8 !important;
    box-shadow: 0 0 0 3px rgba(3, 160, 168, 0.15) !important;
    outline: none !important;
    background: #fff !important;
}

/* Style form labels */
.woocommerce-checkout .form-row label {
    font-weight: 600 !important;
    color: #1e293b !important;
    margin-bottom: 8px !important;
    display: block !important;
    font-family: 'Exo 2', Helvetica, Arial, Lucida, sans-serif !important;
}

.woocommerce-checkout .form-row label .required {
    color: #c91e1e !important;
}

/* Section headings */
.woocommerce-checkout h3 {
    font-family: 'Exo 2', Helvetica, Arial, Lucida, sans-serif !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 20px !important;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (min-width: 768px) {
    #all-categories-dropdowns {
        display: flex;
        justify-content: left;
        gap: 30px;
    }
    
    .zl-w-50 select {
        width: 100%;
    }
    
    #static-unit-c-section .category-product-dropdown {
        width: calc(52% - 42px);
    }
}

@media (max-width: 980px) {
    .checkout .form-row,
    .woocommerce .checkout .col-1,
    .woocommerce .checkout .col-2 {
        margin-bottom: 0px !important;
    }
}

@media (max-width: 991px) {
    .zl-currency-switcher-wrapper > div {
        width: 100%;
    }
    
    #country-selection ul li label,
    #category-selection ul li label {
        margin: 0 auto;
    }
    
    #country-selection ul,
    #category-selection ul {
        list-style: none !important;
        padding: 0;
        padding-bottom: 15px;
    }
    
    h5 {
        padding-left: 10px;
        font-size: 20px;
    }
    
    select {
        width: 270px;
    }
}

@media (min-width: 992px) {
    #country-selection ul,
    #category-selection ul {
        list-style: none !important;
        display: flex;
        justify-content: left;
    }
}

@media (max-width: 768px) {
    .zl-w-50 {
        width: 100%;
    }
    
    #product-selection select {
        width: 100% !important;
    }
    
    .unit_spinner {
        left: 85% !important;
        top: 70% !important;
    }
    
    .category-dropdown h5 {
        font-size: 18px;
    }
    
    #product-selection select {
        width: 90% !important;
        margin-right: 30px;
        padding-right: 30px;
    }
    
    /* Mobile: Stack first/last name but keep them together */
    p#billing_first_name_field,
    p#billing_last_name_field,
    .woocommerce-checkout p#billing_first_name_field,
    .woocommerce-checkout p#billing_last_name_field {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure correct field order on mobile */
    p#billing_first_name_field { order: 1 !important; }
    p#billing_last_name_field { order: 2 !important; }
    p#billing_email_field { order: 3 !important; }
    p#billing_email_confirm_field, .tcv-confirm-email-row { order: 4 !important; }
    p#billing_phone_field { order: 5 !important; }
    p#billing_address_1_field { order: 6 !important; }
    p#billing_city_field { order: 8 !important; }
    p#billing_state_field { order: 10 !important; }
    p#billing_postcode_field { order: 9 !important; }
    p#billing_country_field { order: 11 !important; }
    
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
        gap: 0 !important;
    }
}

@media (max-width: 1399px) {
    #country-selection ul {
        flex-wrap: wrap;
    }
}
