/* Additional CSS Enhancements for One-Page Checkout */
/* Add this file's import to the main CSS or copy contents into one-page-checkout.css */

/* Enhanced Button Loader for Add to Cart */
.wooecom_btn_loader_cart {
    display: none;
    position: absolute;
    left: 15px;
    /* RTL alignment */
    top: 50%;
    transform: translateY(-50%);
}

.wooecom_btn_loader_cart:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #4CAF50;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Additional responsive improvements for select fields */
@media (max-width: 991px) {
    select.input {
        background-size: 14px 14px;
        padding-left: 36px;
    }

    .wooecom_form_section {
        padding: 16px;
        margin-bottom: 12px;
    }

    .wooecom_form_section h3 {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    select.input {
        background-size: 13px 13px;
        padding-left: 34px;
    }

    .wooecom_form_section {
        padding: 14px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    select.input {
        background-size: 12px 12px;
        padding-left: 32px;
        padding: 14px 11px 8px 32px;
    }

    .wooecom_form_section {
        padding: 12px;
        margin-bottom: 8px;
    }

    .wooecom_form_section h3 {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
}

/* Smooth transitions for form sections */
.wooecom_form_section {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Better focus states for accessibility */
.input:focus-visible,
select.input:focus-visible {
    outline: 3px solid rgba(76, 175, 80, 0.3);
    outline-offset: 2px;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {

    .input,
    select.input,
    .wooecom_checkout,
    .wooecom_add_to_cart_btn {
        min-height: 44px;
        /* Accessibility standard */
    }
}

/* ========================================
   WOOCOMMERCE CHECKOUT CUSTOMIZATION
   ======================================== */

/* Hide specific unwanted fields */
.woocommerce-checkout #billing_email_field,
.woocommerce-checkout #billing_last_name_field,
.woocommerce-checkout #billing_company_field,
.woocommerce-checkout #billing_address_1_field,
.woocommerce-checkout #billing_address_2_field,
.woocommerce-checkout #billing_postcode_field,
.woocommerce-checkout #order_comments_field,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields {
    display: none !important;
}

/* Keep shipping options visible */
.woocommerce-checkout .woocommerce-shipping-methods,
.woocommerce-checkout #shipping_method {
    display: block !important;
}

/* Wrap checkout form with our styling */
.woocommerce-checkout-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

/* Style checkout form fields to match product page */
.woocommerce-checkout .woocommerce-billing-fields .form-row {
    margin-bottom: 0;
}

.woocommerce-checkout .input-text,
.woocommerce-checkout select {
    width: 100%;
    padding: 16px 12px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #fff;
    direction: rtl;
}

.woocommerce-checkout select {
    padding-left: 40px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 16px 16px;
    appearance: none;
}

.woocommerce-checkout .input-text:focus,
.woocommerce-checkout select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Floating labels for checkout */
.woocommerce-checkout .form-row label {
    position: absolute;
    right: 12px;
    top: 16px;
    color: #666;
    font-size: 15px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: #fff;
    padding: 0 4px;
}

.woocommerce-checkout .form-row {
    position: relative;
    margin-bottom: 20px;
}

.woocommerce-checkout .input-text.has-value+label,
.woocommerce-checkout .input-text:focus+label,
.woocommerce-checkout select.has-value+label,
.woocommerce-checkout select:focus+label {
    top: -8px;
    font-size: 12px;
    color: #4CAF50;
}

/* Hide labels that are not floating */
.woocommerce-checkout .form-row label abbr {
    display: none;
}

/* Style the place order button */
.woocommerce-checkout #place_order,
.woocommerce-checkout .wc-block-components-button {
    width: 100%;
    padding: 16px 24px;
    background: #4CAF50 !important;
    color: #fff !important;
    border: 2px solid #4CAF50 !important;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.woocommerce-checkout #place_order:hover,
.woocommerce-checkout .wc-block-components-button:hover {
    background: #45a049 !important;
    border-color: #45a049 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Style the order review section */
.woocommerce-checkout #order_review {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}