/**
 * Reorder elements in WooEcom Instant Order Form
 */

/* Force Cairo Font (Fixes CORS/Remote URL issues) */
body,
.wooecom_instant_order_form,
.wooecom_instant_order_form *:not(i):not([class*="fa-"]),
button,
input,
select,
textarea {
    font-family: 'Cairo', sans-serif !important;
}

/* Ensure FontAwesome icons are not overridden */
.fa,
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands,
.wooecom_instant_order_form i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome", sans-serif !important;
}

/* Container Setup */
.wooecom_instant_order_form {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* 1. Notice (Errors/Alerts) */
.wooecom_notice {
    order: 1 !important;
    width: 100% !important;
}

/* 2. Information Title */
.wooecom_information_title {
    order: 2 !important;
    width: 100% !important;
}

/* 3. Variations (Color, Size, etc.) */
.wooecom_variations {
    order: 3 !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid #efefef !important;
    border-top: 1px solid #efefef !important;
    margin-top: 10px !important;
}

/* 4. Contact & Address Fields */
.wooecom_instant_order_form>input,
.wooecom_instant_order_form>select,
.wooecom_instant_order_form>textarea {
    order: 4 !important;
}

/* 5. Shipping Selection */
.purple_seal_shipping_selection {
    order: 5 !important;
    width: 100% !important;
    margin-bottom: 5px !important;
    padding: 15px !important;
    background: #f9f9f9 !important;
    border-radius: 8px !important;
    border: 1px solid #eee !important;
}

.purple_seal_shipping_selection h4 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #333 !important;
}

.wooecom_shipping_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wooecom_shipping_methods li {
    margin-bottom: 10px !important;
}

.wooecom_shipping_methods label {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 15px !important;
    background: #fff !important;
    border: 2px solid #eee !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-weight: 500 !important;
}

.wooecom_shipping_methods input[type="radio"] {
    margin-left: 10px !important;
    margin-top: 0 !important;
    accent-color: #000 !important;
}

.shipping_title {
    flex-grow: 1;
    text-align: left;
    margin-left: 10px;
}

.shipping_cost {
    font-weight: 700;
    color: #000;
}

.wooecom_shipping_methods label:hover {
    border-color: #ddd !important;
}

.wooecom_shipping_methods input:checked+span {
    color: #000 !important;
}

.wooecom_shipping_methods label:has(input:checked) {
    border-color: #000 !important;
    background: #fdfdfd !important;
}

/* Order Summary Multi-item Layout */
.purple_seal_summary_items {
    padding: 10px 0 !important;
}

.purple_seal_summary_item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border-bottom: 1px dashed #eee !important;
}

.purple_seal_summary_item:last-child {
    border-bottom: none !important;
}

.purple_seal_summary_item .product_name {
    font-weight: 500 !important;
    color: #444 !important;
    font-size: 14px !important;
}

.purple_seal_summary_item .product_price {
    font-weight: 600 !important;
    color: #000 !important;
    text-align: right !important;
}

.purple_seal_summary_item .wooecom_order_qty {
    margin-right: 8px !important;
    color: #888 !important;
    font-size: 12px !important;
    background: #f0f0f0 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.purple_seal_summary_item.empty-cart {
    display: none !important;
    justify-content: center !important;
    color: #999 !important;
    font-style: italic !important;
}

/* 6. Quantity & Action Buttons */
.wooecom_instant_order_form>.wooecom_placeholder {
    display: none !important;
}

.wooecom_instant_order_form>.purple_seal_combined_actions {
    order: 6 !important;
    width: 100% !important;
}

.purple_seal_extra_actions_container {
    order: 7 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    margin: 10px 0 !important;
}

.purple_seal_add_more_container,
.purple_seal_whatsapp_container {
    text-align: center !important;
}

.purple_seal_add_more_link,
.purple_seal_whatsapp_link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
}

.purple_seal_add_more_link {
    color: #a48cf4 !important;
}

.purple_seal_whatsapp_link {
    background-color: #25d366 !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 50px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.purple_seal_add_more_link:hover {
    color: #8b6ff2 !important;
    transform: translateY(-1px);
}

.purple_seal_whatsapp_link:hover {
    background-color: #1ebc59 !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.purple_seal_whatsapp_link i {
    font-size: 16px !important;
}


.wooecom_order_summary {
    order: 8 !important;
}

.purple_seal_combined_actions {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    width: 100% !important;
    margin-top: 0px !important;
}

/* Ensure buttons take full width when quantity is hidden */
.purple_seal_combined_actions.sold-individually .purple_seal_actions {
    width: 100% !important;
}

.purple_seal_combined_actions .wooecom_quantity {
    margin: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
    height: 50px !important;
    /* Match button height */
    display: flex !important;
    align-items: center !important;
    border: 1px solid #d9d9d9 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.wooecom_quantity span,
.wooecom_quantity input {
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    margin: 0 !important;
}

.wooecom_quantity input {
    width: 40px !important;
    background: #fff !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    text-align: center !important;
}

.wooecom_quantity span {
    width: 35px !important;
    background: #f1f1f1 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: background 0.2s ease !important;
}

.wooecom_quantity span:hover {
    background: #e5e5e5 !important;
}

.purple_seal_actions {
    display: flex !important;
    gap: 10px !important;
    flex-grow: 1 !important;
}

.purple_seal_combined_actions.no-add-to-cart .wooecom_checkout {
    flex-grow: 1 !important;
    width: 100% !important;
}

/* Shared Button Styles */
.purple_seal_add_to_cart,
.wooecom_checkout {
    flex: 1 !important;
    height: 50px !important;
    /* Unified height */
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    /* Prevent text wrapping */
    padding: 0 15px !important;
    text-decoration: none !important;
}

.purple_seal_add_to_cart {
    background-color: #000 !important;
    color: #fff !important;
}

.wooecom_checkout {
    background-color: #a48cf4 !important;
    color: #fff !important;
}

/* ... existing button styles ... */

.purple_seal_add_to_cart:hover {
    background-color: #333 !important;
}

.wooecom_checkout:hover:not(:disabled) {
    background-color: #8a6dec !important;
}

.wooecom_checkout:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Mobile adjustments for triple-element row */
@media (max-width: 480px) {
    .purple_seal_combined_actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .wooecom_quantity {
        justify-content: center !important;
        margin-bottom: 10px !important;
    }
}

/* Button Loading States */
.purple_seal_btn_loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: purple_seal_spin 0.6s linear infinite;
    display: none;
}

@keyframes purple_seal_spin {
    to {
        transform: rotate(360deg);
    }
}

.loading .purple_seal_btn_loader {
    display: inline-block;
}

.loading i,
.loading span:not(.purple_seal_btn_loader) {
    display: none;
}

/* Special case for Name and Phone to be side by side if possible */
#wooecom_name,
#wooecom_phone {
    width: calc(50% - 10px) !important;
}

/* 5. Variation Display Styles (Label vs List) */

/* List Style (Stacked) */
.wooecom_variations.purple-seal-style-list .attribute_modern_ui {
    display: block !important;
    width: 100% !important;
    margin-bottom: 15px !important;
}

.wooecom_variations.purple-seal-style-list .attribute_inner {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 5px !important;
    width: 100% !important;
}

.wooecom_variations.purple-seal-style-list .attribute_inner label {
    margin: 0 !important;
    flex-grow: 1 !important;
    text-align: left !important;
    padding-left: 10px !important;
}

/* Image Swatch Enhancements */
.attribute_inner.has-image-swatch label {
    width: 45px !important;
    height: 45px !important;
    border: 2px solid #ddd !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.attribute_inner.has-image-swatch input:checked+label {
    border-color: #000 !important;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2) !important;
}

.attribute_inner.has-image-swatch .swatch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.attribute_inner.has-image-swatch label:hover .swatch-overlay {
    background: rgba(0, 0, 0, 0.1);
}

/* General Attribute Fixes */
.attribute_modern_ui h4 {
    margin-bottom: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Mobile Responsiveness for side-by-side fields */
@media (max-width: 767px) {

    #wooecom_name,
    #wooecom_phone {
        width: 100% !important;
    }
}

/* Fixed Charges label styling */
.wooecom_shipping_prices {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.wooecom_fixed_charges_label {
    font-weight: 600;
    font-size: 14px;
    color: inherit;
}