/*-----------------------------------------------------------------------------------------------------------
# REGISTRATION FORM STYLING (Applied to Checkout)
-----------------------------------------------------------------------------------------------------------*/

/* Form container */
.mb-form,
.account-section {
    float: left;
    width: 100%;
}

/* Form labels */
.mb-form label,
.account-section label {
    display: block;
    clear: both;
    width: 300px;
    padding-right: 20px;
    font-family: "proxima_novabold", "proxima_novaregular", Helvetica, Arial, sans-serif;
    font-size: 16px;
    margin-bottom: 3px;
    color: #4f5458;
}

/* Form inputs, selects, textareas */
.mb-form input[type=text],
.mb-form input[type=subject],
.mb-form input[type=tel],
.mb-form input[type=email],
.mb-form input[type=text],
.mb-form input[type=password],
.mb-form .select2-container,
.account-section input[type=text],
.account-section input[type=subject],
.account-section input[type=tel],
.account-section input[type=email],
.account-section input[type=text],
.account-section input[type=password],
.account-section .select2-container {
    display: block;
    clear: both;
    width: 300px !important;
    padding-right: 20px;
    font-size: 16px;
    margin-bottom: 30px;
    color: #4f5458;
    font-family: "proxima_novaregular", Helvetica, Arial, sans-serif;
    padding: 8px 10px;
    margin-bottom: 30px;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Third column layout for 3-column forms */
.third {
    width: 32%;
    margin-right: 2%;
    float: left;
}

.third.last {
    margin-right: 0;
}

/* Form group attached styling */
.form-group-attached {
    margin-bottom: 20px;
}

/*-----------------------------------------------------------------------------------------------------------
# CHECKOUT FORM STYLING (Updated to match registration)
-----------------------------------------------------------------------------------------------------------*/

/* Apply registration form styling to checkout */
.woocommerce-checkout .woocommerce-billing-fields {
    float: left;
    width: 100%;
}

.woocommerce-error a {
    color: #fff;
}
.show-password-input {
    display: none;
}

.cart_item td {
    border-top: 1px solid #ef4129;
    border-bottom: 1px solid #ef4129;
}

.coupon {
    float: right;
    clear: both;
}

.pull-left, .pull-right {
    display: inline;
} 
.pull-right { 
    float: right; 
}  
/* Checkout form input fields - updated to match registration */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout textarea,
.woocommerce-checkout select {
    display: block;
    clear: both;
    width: 300px;
    padding: 8px 10px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'proxima_novaregular', Helvetica, Arial, sans-serif;
    color: #4f5458;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 30px;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.woocommerce-checkout input[type="text"]:focus,
.woocommerce-checkout input[type="email"]:focus,
.woocommerce-checkout input[type="tel"]:focus,
.woocommerce-checkout input[type="password"]:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus {
    outline: none;
    border-color: #ef4129;
    box-shadow: 0 0 0 3px rgba(239, 65, 41, 0.1);
    background-color: #ffffff;
}

.woocommerce-checkout input[type="text"]:hover,
.woocommerce-checkout input[type="email"]:hover,
.woocommerce-checkout input[type="tel"]:hover,
.woocommerce-checkout input[type="password"]:hover,
.woocommerce-checkout textarea:hover,
.woocommerce-checkout select:hover {
    border-color: #cccccc;
}

/* Select dropdown styling */
.woocommerce-checkout select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
}

.woocommerce-checkout select option {
    padding: 8px;
    background-color: #ffffff;
    color: #4f5458;
}

/* Placeholder text styling */
.woocommerce-checkout input::placeholder,
.woocommerce-checkout textarea::placeholder {
    color: #999999;
    font-style: italic;
}

/* Form labels - updated to match registration */
.woocommerce-checkout label {
    display: block;
    clear: both;
    width: 300px;
    padding-right: 20px;
    font-family: 'proxima_novabold', 'proxima_novaregular', Helvetica, Arial, sans-serif;
    font-size: 16px;
    margin-bottom: 3px;
    color: #4f5458;
}

/* Required field indicator */
.woocommerce-checkout .required {
    color: #ef4129;
}

/* Form field containers */
.woocommerce-checkout .form-row {
    margin-bottom: 20px;
}

.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
    /* width: 48%; */
    float: left;
}

.woocommerce-checkout .form-row-last {
    float: right;
}

.woocommerce-checkout .form-row-wide {
    clear: both;
}

.form-row:nth-child(3n+3) input, .form-row:nth-child(3n+3) label {
    margin:0;
}

.form-row:nth-child(3n+1) input, .form-row:nth-child(3n+1) label {
    float: none;
}

.mb-form label[for=fm_state], .mb-form #s2id_fm_state, .mb-form label[for=billing_state], .mb-form #billing_state, .account-section label[for=fm_state], .account-section #s2id_fm_state, .account-section label[for=billing_state], .account-section #billing_state {
    max-width: 300px;
    width: inherit;
}

/* Error states */
.woocommerce-checkout .woocommerce-invalid input,
.woocommerce-checkout .woocommerce-invalid select,
.woocommerce-checkout .woocommerce-invalid textarea {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.woocommerce-checkout .woocommerce-invalid input:focus,
.woocommerce-checkout .woocommerce-invalid select:focus,
.woocommerce-checkout .woocommerce-invalid textarea:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Success states */
.woocommerce-checkout .woocommerce-validated input,
.woocommerce-checkout .woocommerce-validated select,
.woocommerce-checkout .woocommerce-validated textarea {
    border-color: #28a745;
}

/*-----------------------------------------------------------------------------------------------------------
# COUPON FORM STYLING
-----------------------------------------------------------------------------------------------------------*/

/* Make coupon form float right */
.checkout_coupon,
.checkout_coupon.gray-background {
    float: right !important;
    clear: both;
    width: 376px;
    padding: 0 20px 20px;
}

.checkout_coupon.gray-background input[type=text] {
    width: 241px;
}

/* Checkout form rows - updated for 3-column layout like registration */
.checkout-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.checkout-row .form-row {
    flex: 1;
    margin-bottom: 0 !important;
}

.checkout-row-1 .form-row {
    flex: 1;
}

/* Make row 1 use third columns like registration */
.checkout-row-1 {
    display: flex;
    gap: 2%;
    margin-bottom: 20px;
    align-items: flex-start;
}

.checkout-row-1 .form-row {
    flex: 0 0 32%;
    margin-bottom: 0 !important;
}

.checkout-row-2 .form-row {
    flex: 1;
}

/* Make row 2 also use third columns */
.checkout-row-2 {
    display: flex;
    gap: 2%;
    margin-bottom: 20px;
    align-items: flex-start;
}

.checkout-row-2 .form-row {
    flex: 0 0 32%;
    margin-bottom: 0 !important;
}

.checkout-row-3 .form-row {
    width: 100%;
}

/* Responsive adjustments for checkout rows */
@media (max-width: 768px) {
    .checkout-row,
    .checkout-row-1,
    .checkout-row-2 {
        flex-direction: column;
        gap: 10px;
    }

    .checkout-row .form-row,
    .checkout-row-1 .form-row,
    .checkout-row-2 .form-row {
        width: 100%;
        flex: none;
    }

    .woocommerce-checkout input[type="text"],
    .woocommerce-checkout input[type="email"],
    .woocommerce-checkout input[type="tel"],
    .woocommerce-checkout input[type="password"],
    .woocommerce-checkout textarea,
    .woocommerce-checkout select,
    .mb-form input[type=text],
    .mb-form input[type=email],
    .mb-form input[type=tel],
    .account-section input[type=text],
    .account-section input[type=email],
    .account-section input[type=tel] {
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
    }

    .woocommerce-checkout label,
    .mb-form label,
    .account-section label {
        width: 100%;
    }
}