/**
 * Store Closed Manager - Frontend Styles
 */

/* Store Closed Messages */
.scm-store-closed-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
    margin: 15px 0;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

.scm-single-product-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 20px 25px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    text-align: center;
    margin: 25px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

/* Shop page closed notice */
.scm-shop-closed-notice {
    margin-bottom: 30px;
    padding: 0 15px;
}

.scm-shop-closed-notice .scm-store-closed-message {
    font-size: 16px;
    padding: 20px;
    margin: 20px 0;
}

/* Bypass Success/Error Messages */
.scm-bypass-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    z-index: 999999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-weight: 500;
    max-width: 300px;
    animation: scmSlideInRight 0.3s ease-out;
}

.scm-bypass-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.scm-bypass-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes scmSlideInRight {
    from { 
        transform: translateX(100%);
        opacity: 0;
    }
    to { 
        transform: translateX(0);
        opacity: 1;
    }
}

/* Hide add to cart buttons when store is closed */
.scm-store-closed .single_add_to_cart_button,
.scm-store-closed .add_to_cart_button,
.scm-store-closed .wc-forward,
.scm-store-closed .single_add_to_cart,
.scm-store-closed .add_to_cart,
.scm-store-closed button[type="submit"][name="add-to-cart"],
.scm-store-closed input[type="submit"][name="add-to-cart"],
.scm-store-closed .woocommerce-variation-add-to-cart,
.scm-store-closed .variations_button,
.scm-store-closed .woocommerce-grouped-product-list-item__add-to-cart,
/* Standard WooCommerce button classes */
.scm-store-closed .woocommerce a.button,
.scm-store-closed .woocommerce button.button,
.scm-store-closed .woocommerce input.button,
.scm-store-closed .woocommerce a.add_to_cart_button,
/* Additional WooCommerce selectors */
.scm-store-closed .woocommerce ul.products li.product .button.add_to_cart_button,
.scm-store-closed .woocommerce div.product form.cart .button.single_add_to_cart_button,
.scm-store-closed .woocommerce a[href*="add-to-cart"],
.scm-store-closed .woocommerce button[data-product_id],
.scm-store-closed .woocommerce .add_to_cart,
.scm-store-closed .woocommerce .single_add_to_cart,
/* SeedProd specific selectors - ONLY hide WooCommerce add-to-cart buttons */
.scm-store-closed .wp-element-button,
.scm-store-closed .wc-variation-selection-needed,
.scm-store-closed .single_add_to_cart_button.sp-button,
.scm-store-closed .woocommerce-variation-add-to-cart-disabled,
/* More aggressive SeedProd targeting - ONLY WooCommerce add-to-cart */
.scm-store-closed button[class*="single_add_to_cart_button"],
.scm-store-closed button[type="submit"][class*="single_add_to_cart_button"],
.scm-store-closed .single_add_to_cart_button[class*="sp-button"],
.scm-store-closed .single_add_to_cart_button[class*="wp-element-button"] {
    display: none !important;
}

/* ALLOW SeedProd form buttons to be visible */
.scm-store-closed .sp-button:not(.single_add_to_cart_button):not(.add_to_cart_button),
.scm-store-closed button.sp-button:not(.single_add_to_cart_button):not(.add_to_cart_button),
.scm-store-closed button[class*="sp-button"]:not(.single_add_to_cart_button):not(.add_to_cart_button),
.scm-store-closed button[class*="sp-optin-submit"]:not(.single_add_to_cart_button):not(.add_to_cart_button) {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Product variation handling */
.scm-store-closed .variations_button {
    display: none !important;
}

.scm-store-closed .woocommerce-variation-add-to-cart {
    display: none !important;
}

/* Hide entire variation wrapper */
.scm-store-closed .woocommerce-variation-add-to-cart.variations_button {
    display: none !important;
}

/* Hide quantity inputs */
.scm-store-closed .quantity,
.scm-store-closed .quantity input,
.scm-store-closed .qty,
.scm-store-closed input[name="quantity"] {
    display: none !important;
}

/* Ultra-specific SeedProd targeting */
.scm-store-closed div.woocommerce-variation-add-to-cart.variations_button,
.scm-store-closed div.woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-disabled,
.scm-store-closed button[type="submit"][name="add-to-cart"],
.scm-store-closed button[type="submit"][class*="single_add_to_cart_button"][class*="sp-button"],
.scm-store-closed button[type="submit"][class*="single_add_to_cart_button"][class*="wp-element-button"],
.scm-store-closed button[type="submit"][class*="single_add_to_cart_button"][class*="alt"],
.scm-store-closed button[type="submit"][class*="single_add_to_cart_button"][class*="wc-variation-selection-needed"],
/* Target any button containing "Add To Cart" text */
.scm-store-closed button:contains("Add To Cart"),
.scm-store-closed button:contains("Add to Cart"),
.scm-store-closed button[class*="single_add_to_cart_button"]:contains("Add To Cart") {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* SeedProd specific selectors */
.scm-store-closed .seedprod-add-to-cart,
.scm-store-closed .seedprod-product-add-to-cart,
.scm-store-closed [class*="seedprod"][class*="add-to-cart"],
.scm-store-closed .sp-add-to-cart {
    display: none !important;
}

/* SeedProd product page support */
.scm-store-closed .seedprod-product-summary .seedprod-add-to-cart,
.scm-store-closed .seedprod-product-summary .add_to_cart_button {
    display: none !important;
}

/* Ensure custom messages are visible */
.scm-store-closed-message,
.scm-single-product-message {
    display: block !important;
    visibility: visible !important;
}

/* Disabled button styling - only for WooCommerce add-to-cart buttons */
.scm-disabled-button.single_add_to_cart_button,
.scm-disabled-button.add_to_cart_button,
.scm-disabled-button.sp-button,
.scm-disabled-button[name="add-to-cart"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Additional product page selectors */
.scm-store-closed .product-type-simple .cart,
.scm-store-closed .product-type-variable .cart,
.scm-store-closed .product-type-grouped .cart,
.scm-store-closed .product-type-external .cart {
    display: none !important;
}

/* Variation forms */
.scm-store-closed .variations_form,
.scm-store-closed .woocommerce-variation-add-to-cart-wrapper {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scm-bypass-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .scm-single-product-message {
        padding: 15px 20px;
        font-size: 14px;
    }
    
    .scm-store-closed-message {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Theme compatibility */
.scm-store-closed-message *,
.scm-single-product-message *,
.scm-bypass-message * {
    color: inherit !important;
    background: transparent !important;
}

/* Hide ONLY WooCommerce add-to-cart buttons when store is closed */
.scm-store-closed button[type="submit"][name="add-to-cart"],
.scm-store-closed input[type="submit"][name="add-to-cart"],
.scm-store-closed .woocommerce button[type="submit"][name="add-to-cart"],
.scm-store-closed .woocommerce input[type="submit"][name="add-to-cart"] {
    display: none !important;
}

/* EXACT targeting for the provided HTML structure */
.scm-store-closed .woocommerce-variation-add-to-cart.variations_button.woocommerce-variation-add-to-cart-disabled,
.scm-store-closed .single_add_to_cart_button.sp-button.alt.wp-element-button.disabled.wc-variation-selection-needed,
.scm-store-closed button[type="submit"][class*="single_add_to_cart_button"][class*="sp-button"][class*="alt"][class*="wp-element-button"][class*="disabled"][class*="wc-variation-selection-needed"],
.scm-store-closed button[type="submit"][name="add-to-cart"][value="688"][class*="single_add_to_cart_button"][class*="sp-button"][class*="alt"][class*="wp-element-button"],
.scm-store-closed button[type="submit"][name="add-to-cart"][class*="single_add_to_cart_button"][class*="sp-button"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

/* But show our custom message */
.scm-store-closed .scm-store-closed-message,
.scm-store-closed .scm-single-product-message {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* EXTREME targeting - hide ONLY WooCommerce add to cart buttons */
.scm-store-closed .woocommerce .single_add_to_cart_button,
.scm-store-closed .woocommerce .add_to_cart_button,
.scm-store-closed .woocommerce button[name="add-to-cart"],
.scm-store-closed .woocommerce input[name="add-to-cart"] {
    display: none !important;
}

/* Show custom message when store is closed - EXCLUDE SeedProd form buttons */
.scm-store-closed .single_add_to_cart_button::after,
.scm-store-closed .add_to_cart_button::after {
    content: "Store is currently closed. We will reopen soon!" !important;
    display: block !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
    padding: 15px !important;
    border: 1px solid #f5c6cb !important;
    border-radius: 4px !important;
    text-align: center !important;
    margin: 15px 0 !important;
    font-weight: 500 !important;
    position: relative !important;
    z-index: 999 !important;
}

/* Hide the button text but show our message - EXCLUDE SeedProd form buttons */
.scm-store-closed .single_add_to_cart_button,
.scm-store-closed .add_to_cart_button {
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    min-height: 60px !important;
}

/* Override for our messages only */
.scm-store-closed .scm-store-closed-message button,
.scm-store-closed .scm-single-product-message button {
    display: block !important;
}

/* IMPORTANT: Allow ALL non-WooCommerce buttons to remain visible */
.scm-store-closed button:not(.single_add_to_cart_button):not(.add_to_cart_button):not(.sp-button):not([name="add-to-cart"]):not([class*="add_to_cart"]):not([class*="wc-"]),
.scm-store-closed input[type="submit"]:not([name="add-to-cart"]):not([class*="add_to_cart"]):not([class*="wc-"]),
.scm-store-closed input[type="button"]:not([class*="add_to_cart"]):not([class*="wc-"]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Specifically allow contact form and other form buttons */
.scm-store-closed .wpcf7 button,
.scm-store-closed .wpcf7 input[type="submit"],
.scm-store-closed .contact-form button,
.scm-store-closed .contact-form input[type="submit"],
.scm-store-closed .gform_wrapper button,
.scm-store-closed .gform_wrapper input[type="submit"],
.scm-store-closed form:not(.cart):not(.woocommerce) button,
.scm-store-closed form:not(.cart):not(.woocommerce) input[type="submit"],
.scm-store-closed .wpforms-form button,
.scm-store-closed .wpforms-form input[type="submit"],
.scm-store-closed .ninja-forms-cont button,
.scm-store-closed .ninja-forms-cont input[type="submit"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure messages work with various themes */
.woocommerce .scm-store-closed-message,
.woocommerce .scm-single-product-message {
    margin-left: 0;
    margin-right: 0;
}

/* Override any theme button styles for our messages */
.scm-store-closed-message,
.scm-single-product-message {
    cursor: default !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: none !important;
}

.scm-store-closed-message:hover,
.scm-single-product-message:hover {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    transform: none !important;
}

/* FINAL OVERRIDE: Ensure all non-WooCommerce buttons are visible and properly styled */
.scm-store-closed button[type="submit"]:not([name="add-to-cart"]):not(.single_add_to_cart_button):not(.add_to_cart_button):not(.sp-button),
.scm-store-closed input[type="submit"]:not([name="add-to-cart"]),
.scm-store-closed button:not(.single_add_to_cart_button):not(.add_to_cart_button):not(.sp-button):not([name="add-to-cart"]) {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: auto !important;
    padding: initial !important;
    margin: initial !important;
    border: initial !important;
    font-size: initial !important;
    line-height: initial !important;
    background: initial !important;
    color: initial !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    text-decoration: initial !important;
    box-shadow: initial !important;
    transition: initial !important;
    transform: initial !important;
}

/* Specifically restore form button styling */
.scm-store-closed .wpcf7 button,
.scm-store-closed .wpcf7 input[type="submit"],
.scm-store-closed .contact-form button,
.scm-store-closed .contact-form input[type="submit"],
.scm-store-closed .gform_wrapper button,
.scm-store-closed .gform_wrapper input[type="submit"],
.scm-store-closed .wpforms-form button,
.scm-store-closed .wpforms-form input[type="submit"],
.scm-store-closed .ninja-forms-cont button,
.scm-store-closed .ninja-forms-cont input[type="submit"],
.scm-store-closed form:not(.cart):not(.woocommerce) button,
.scm-store-closed form:not(.cart):not(.woocommerce) input[type="submit"] {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: initial !important;
    color: initial !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    text-decoration: initial !important;
    box-shadow: initial !important;
    transition: initial !important;
    transform: initial !important;
    border: initial !important;
    padding: initial !important;
    margin: initial !important;
    font-size: initial !important;
    line-height: initial !important;
    font-weight: initial !important;
    font-family: initial !important;
    height: auto !important;
    width: auto !important;
    min-height: initial !important;
    min-width: initial !important;
}

/* Ensure form buttons don't inherit disabled styling */
.scm-store-closed button:not(.single_add_to_cart_button):not(.add_to_cart_button):not(.sp-button):not([name="add-to-cart"]):not([disabled]),
.scm-store-closed input[type="submit"]:not([name="add-to-cart"]):not([disabled]),
.scm-store-closed input[type="button"]:not([disabled]) {
    background-color: initial !important;
    color: initial !important;
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Specifically fix SeedProd optin buttons - use !important overrides */
.scm-store-closed .sp-optin-submit,
.scm-store-closed button.sp-optin-submit,
.scm-store-closed .sp-button:not(.single_add_to_cart_button):not(.add_to_cart_button) {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: inherit !important;
    background-color: inherit !important;
    color: inherit !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    text-decoration: inherit !important;
    box-shadow: inherit !important;
    transition: inherit !important;
    transform: inherit !important;
    border: inherit !important;
    padding: inherit !important;
    margin: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
    height: auto !important;
    width: auto !important;
    min-height: inherit !important;
    min-width: inherit !important;
}

/* Force normal button appearance for all non-WooCommerce buttons */
.scm-store-closed button:not(.single_add_to_cart_button):not(.add_to_cart_button):not([name="add-to-cart"]):not([disabled]),
.scm-store-closed input[type="submit"]:not([name="add-to-cart"]):not([disabled]),
.scm-store-closed input[type="button"]:not([disabled]) {
    background: inherit !important;
    background-color: inherit !important;
    color: inherit !important;
    opacity: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    border: inherit !important;
    padding: inherit !important;
    margin: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
    text-decoration: inherit !important;
    box-shadow: inherit !important;
    transition: inherit !important;
    transform: inherit !important;
    height: auto !important;
    width: auto !important;
    min-height: inherit !important;
    min-width: inherit !important;
}

/* ULTRA-AGGRESSIVE: Prevent any button from being greyed out */
.scm-store-closed button:not(.single_add_to_cart_button):not(.add_to_cart_button):not([name="add-to-cart"]),
.scm-store-closed input[type="submit"]:not([name="add-to-cart"]),
.scm-store-closed input[type="button"] {
    opacity: 1 !important;
    filter: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
    -o-filter: none !important;
}

/* NUCLEAR OPTION: Override ANY possible styling that could grey out buttons */
body.scm-store-closed button:not(.single_add_to_cart_button):not(.add_to_cart_button):not([name="add-to-cart"]):not([disabled]),
body.scm-store-closed input[type="submit"]:not([name="add-to-cart"]):not([disabled]),
body.scm-store-closed input[type="button"]:not([disabled]),
body.scm-store-closed span[id*="sp-"],
body.scm-store-closed span.sp-button,
body.scm-store-closed span[class*="submit"],
body.scm-store-closed span[class*="button"],
body.scm-store-closed button[id*="sp-"],
body.scm-store-closed button.sp-button:not(.single_add_to_cart_button):not(.add_to_cart_button),
body.scm-store-closed button[class*="sp-optin-submit"],
body.scm-store-closed button[class*="sp-button"]:not(.single_add_to_cart_button):not(.add_to_cart_button),
/* GENERAL sp-button protection - excludes WooCommerce add-to-cart buttons */
body.scm-store-closed .sp-button:not(.single_add_to_cart_button):not(.add_to_cart_button):not([name="add-to-cart"]) {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
    -o-filter: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: revert !important;
    background-color: revert !important;
    color: revert !important;
    border: revert !important;
    padding: revert !important;
    margin: revert !important;
    font-size: revert !important;
    line-height: revert !important;
    font-weight: revert !important;
    font-family: revert !important;
    text-decoration: revert !important;
    box-shadow: revert !important;
    transition: revert !important;
    transform: revert !important;
    height: revert !important;
    width: revert !important;
    min-height: revert !important;
    min-width: revert !important;
}

/* SPECIFIC FIX for the exact button you mentioned */
body.scm-store-closed span#sp-tkqz7c4wdk {
    opacity: 1 !important;
    filter: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: revert !important;
    background-color: revert !important;
    color: revert !important;
    display: inline-block !important;
    visibility: visible !important;
}

/* SPECIFIC FIX for the button with span inside */
body.scm-store-closed button#sp-htu7wqwbf5,
body.scm-store-closed button#sp-htu7wqwbf5 span#sp-x27evrtqvh {
    opacity: 1 !important;
    filter: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: revert !important;
    background-color: revert !important;
    color: revert !important;
    display: inline-block !important;
    visibility: visible !important;
}

/* GENERAL FIX for all SeedProd button structures */
body.scm-store-closed button[class*="sp-optin-submit"],
body.scm-store-closed button[class*="sp-optin-submit"] span {
    opacity: 1 !important;
    filter: none !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: revert !important;
    background-color: revert !important;
    color: revert !important;
    display: inline-block !important;
    visibility: visible !important;
}

/* OVERRIDE ALL GREYING - Preserve original button appearance */
html body.scm-store-closed button.sp-button.sp-optin-submit,
html body.scm-store-closed button[class*="sp-optin-submit"]:not(.single_add_to_cart_button):not(.add_to_cart_button) {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    -moz-filter: none !important;
    -ms-filter: none !important;
    -o-filter: none !important;
    background: revert !important;
    background-color: revert !important;
    color: revert !important;
    border: revert !important;
    padding: revert !important;
    margin: revert !important;
    font-size: revert !important;
    line-height: revert !important;
    font-weight: revert !important;
    font-family: revert !important;
    text-decoration: revert !important;
    box-shadow: revert !important;
    transition: revert !important;
    transform: revert !important;
    height: revert !important;
    width: revert !important;
    min-height: revert !important;
    min-width: revert !important;
    display: revert !important;
    visibility: revert !important;
    cursor: revert !important;
    pointer-events: revert !important;
}

/* Also fix the inner span */
html body.scm-store-closed button.sp-button.sp-optin-submit span,
html body.scm-store-closed button[class*="sp-optin-submit"] span {
    opacity: 1 !important;
    filter: none !important;
    background: revert !important;
    background-color: revert !important;
    color: revert !important;
    display: revert !important;
    visibility: revert !important;
}
