/*
 * Disabled buy controls, while the sale is deactivated.
 *
 * Driven off the body class rather than a class on each button: the theme
 * swaps whole nodes out on every AJAX re-render and cart fragment refresh, so
 * anything applied to the buttons themselves would not survive.
 *
 * Do NOT add pointer-events: none here. The click has to reach the capture
 * listener in assets/sale/js/frontend.js, or the popup never opens. Selector
 * list is kept in sync with BLOCKED in that file.
 */
body.ezyhut-sale-disabled [data-ezy-quick-add],
body.ezyhut-sale-disabled .single_add_to_cart_button,
body.ezyhut-sale-disabled a.add_to_cart_button,
body.ezyhut-sale-disabled a.ajax_add_to_cart,
body.ezyhut-sale-disabled .wc-block-components-product-button__button,
body.ezyhut-sale-disabled .wc-block-components-product-button button,
body.ezyhut-sale-disabled .checkout-button,
body.ezyhut-sale-disabled #place_order,
body.ezyhut-sale-disabled .wc-block-cart__submit-button,
body.ezyhut-sale-disabled .wc-block-components-checkout-place-order-button,
body.ezyhut-sale-disabled .woocommerce-mini-cart__buttons a.checkout,
body.ezyhut-sale-disabled .ezy-cart-drawer__foot a.ezy-btn:not(.ezy-btn--outline) {
    opacity: 0.55;
    filter: grayscale(1);
    cursor: not-allowed;
}

/* Popup Overlay */
.ezyhut-sale-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ezyhut-sale-popup-overlay.active {
    opacity: 1;
}

/* Popup Container */
.ezyhut-sale-popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.ezyhut-sale-popup-overlay.active .ezyhut-sale-popup {
    transform: scale(1);
}

/* Popup Header */
.ezyhut-sale-popup-header {
    background: #ffffff;
    color: #333;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
}

.ezyhut-sale-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.ezyhut-sale-popup-close {
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    color: #999;
    opacity: 1;
    font-weight: normal;
}

.ezyhut-sale-popup-close:hover {
    color: #333;
}

/* Popup Content */
.ezyhut-sale-popup-content {
    padding: 40px 25px;
    text-align: center;
    background: #ffffff;
}

.ezyhut-sale-popup-content p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin: 0;
    font-weight: 400;
}

/* Popup Footer */
.ezyhut-sale-popup-footer {
    padding: 20px 25px;
    text-align: center;
    border-top: 1px solid #e5e5e5;
    background-color: #ffffff;
}

.ezyhut-sale-popup-btn {
    background: #1d8d60;
    color: #ffffff;
    border: none;
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ezyhut-sale-popup-btn:hover {
    background: #166b4a;
}

.ezyhut-sale-popup-btn:active {
    transform: scale(0.98);
}

/* Responsive Design */
@media (max-width: 600px) {
    .ezyhut-sale-popup {
        max-width: 95%;
    }

    .ezyhut-sale-popup-header h3 {
        font-size: 18px;
    }

    .ezyhut-sale-popup-content p {
        font-size: 14px;
    }

    .ezyhut-sale-popup-btn {
        padding: 10px 30px;
        font-size: 14px;
    }
}
