#popup-checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInBackdrop 0.3s ease;
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

.popup-checkout-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 35px;
    border-radius: 20px;
    min-width: 320px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.5) transparent;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

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

.popup-checkout-content::-webkit-scrollbar {
    width: 8px;
}

.popup-checkout-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.popup-checkout-content::-webkit-scrollbar-thumb {
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.popup-checkout-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Gateway image size */
#popup-checkout-modal .payment_methods img {
    max-width: 60px !important;
    height: auto !important;
    vertical-align: middle;
}

/* Place Order button full width */
#popup-checkout-modal .woocommerce-checkout .button,
#popup-checkout-modal .woocommerce-checkout button.button {
    width: 100% !important;
    display: block !important;
}

/* Extra Dot Hide from Shipping Section */
#popup-checkout-modal .woocommerce-shipping-methods li {
    list-style: none !important;
    position: relative;
    padding-left: 0 !important;
}

#popup-checkout-modal .woocommerce-shipping-methods li::before,
#popup-checkout-modal .woocommerce-shipping-methods li::after {
    display: none !important;
    content: none !important;
}





/* Mobile Popup Responsive Fixes */
@media (max-width: 768px) {
    .popup-checkout-content {
        width: 95%;
        max-width: 95%;
        padding: 20px 15px;
        max-height: 90vh;
    }

    .popup-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .popup-checkout-content {
        width: 98%;
        max-width: 98%;
        padding: 15px 10px;
        border-radius: 12px;
    }



    /* Hide default WooCommerce coupon at top */
    #popup-checkout-modal .woocommerce-form-coupon-toggle {
        display: none !important;
    }

    #popup-checkout-modal .checkout_coupon.woocommerce-form-coupon {
        display: none !important;
    }




}

/* Buy now button disable for variation product */
.popup-buy-now[disabled],
.popup-buy-now.popup-buy-now-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Gateway section container */
#popup-checkout-modal .wc_payment_methods {
    background: #f7f7fb;
    border-radius: 10px;
    padding: 18px 16px 10px 16px;
    margin-bottom: 18px;
}

/* Gateway radio */
#popup-checkout-modal .wc_payment_methods .payment_method {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

#popup-checkout-modal .wc_payment_methods input[type="radio"] {
    accent-color: #ff3c3c;
    /* Modern browsers */
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

#popup-checkout-modal .wc_payment_methods label {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 0;
    cursor: pointer;
}

#popup-checkout-modal .wc_payment_methods .payment_box {
    background: #ededf7;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0 0 26px;
    font-size: 14px;
    color: #444;
    border: none;
    box-shadow: none;
}

/* Gateway List - Dot/Bullet Hide */
#popup-checkout-modal .wc_payment_methods,
#popup-checkout-modal .woocommerce-checkout .wc_payment_methods {
    padding-left: 0 !important;
}

#popup-checkout-modal .wc_payment_methods li,
#popup-checkout-modal .woocommerce-checkout .wc_payment_methods li {
    list-style: none !important;
    position: relative;
    padding-left: 0 !important;
}

#popup-checkout-modal .wc_payment_methods li::before,
#popup-checkout-modal .wc_payment_methods li::after,
#popup-checkout-modal .woocommerce-checkout .wc_payment_methods li::before,
#popup-checkout-modal .woocommerce-checkout .wc_payment_methods li::after {
    display: none !important;
    content: none !important;
}

/*Gateway Image Size Control */
#popup-checkout-modal .payment_methods img,
#popup-checkout-modal .wc_payment_methods img {
    max-width: 32px !important;
    max-height: 32px !important;
    width: auto !important;
    height: auto !important;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 6px;
    box-shadow: none;
}

/* Gateway Image Label Align */
#popup-checkout-modal .payment_methods label,
#popup-checkout-modal .wc_payment_methods label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
}

/* Universal Resets for Popup */
#popup-checkout-modal * {
    box-sizing: border-box;
}

#popup-checkout-modal input[type="text"],
#popup-checkout-modal input[type="email"],
#popup-checkout-modal input[type="tel"],
#popup-checkout-modal input[type="password"],
#popup-checkout-modal textarea,
#popup-checkout-modal select {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 40px;
}

/* Fluid Widths for Fields */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper,
p#order_comments_field {
    width: 100% !important;
    max-width: 100% !important;
}

/* Coupon Field Specifics */
input#popup_coupon_code {
    width: auto !important;
    flex: 1;
    min-width: 120px;
}

button#popup_apply_coupon {
    padding: 12px 16px !important;
    background: #000 !important;
    width: auto !important;
}

.woocommerce-js ul#shipping_method li input {
    margin: 3px 8px !important;
}

.popup-buy-now {
    min-width: 120px;
    white-space: nowrap;
    word-break: normal;
    overflow: hidden;
    text-align: center;
    width: 100%;
    display: inline-block;
}

/* Mobile Popup Responsive Fixes */
@media (max-width: 768px) {
    .popup-checkout-content {
        width: 95%;
        max-width: 95%;
        padding: 20px 15px;
        max-height: 90vh;
    }

    .popup-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .popup-buy-now {
        min-width: 90px;
        font-size: 15px;
        padding: 10px 10px;
    }
}

@media (max-width: 480px) {
    .popup-checkout-content {
        width: 98%;
        max-width: 98%;
        padding: 15px 10px;
        border-radius: 12px;
    }

    /* Hide default WooCommerce coupon at top */
    #popup-checkout-modal .woocommerce-form-coupon-toggle,
    #popup-checkout-modal .checkout_coupon.woocommerce-form-coupon {
        display: none !important;
    }
}

/* Desktop Layout Fixes */
@media (min-width: 768px) {
    .popup-checkout-content {
        max-width: 600px;
        /* Single column comfortable width */
    }

    /* Ensure single column stacking */
    #popup-checkout-modal form.checkout {
        display: block;
    }

    #popup-checkout-modal #customer_details,
    #popup-checkout-modal .col2-set,
    #popup-checkout-modal #order_review,
    #popup-checkout-modal #order_review_heading,
    #popup-checkout-modal .woocommerce-checkout-review-order {
        width: 100%;
        float: none;
        clear: both;
        margin: 0 0 20px 0;
    }
}