/**
 * Shop/Category Page Add to Quote Button Fix
 * Ensures button is always visible and properly styled
 * FORCES VISIBILITY - NO HOVER REQUIRED!
 */

/* CRITICAL: Remove ALL inline styles that hide buttons */
[style*="display: none"].add-to-quote-button,
[style*="visibility: hidden"].add-to-quote-button,
[style*="opacity: 0"].add-to-quote-button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* OVERRIDE THEME'S HOVER-ONLY BEHAVIOR */
.woo-archive-action-on-hover .add-to-quote-button,
.woo-archive-action-on-hover .woocommerce-LoopProduct-link + .add-to-quote-button,
.woo-archive-action-on-hover li.product .add-to-quote-button,
.woo-archive-action-on-hover .product .add-to-quote-button,
.woo-archive-action-on-hover .product-action-wrap .add-to-quote-button,
.woo-archive-action-on-hover .products .add-to-quote-button {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative !important;
    transform: none !important;
    transition: none !important;
}

/* Override the parent wrapper that hides actions */
.woo-archive-action-on-hover .product-action-wrap,
.woo-archive-action-on-hover .woocommerce-loop-product__buttons,
.woo-archive-action-on-hover .product-loop-action,
.woo-archive-action-on-hover .loop-product-buttons {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative !important;
    bottom: auto !important;
    transform: none !important;
}

/* Force visibility on non-hover state specifically */
.woo-archive-action-on-hover li.product:not(:hover) .add-to-quote-button,
.woo-archive-action-on-hover .product:not(:hover) .add-to-quote-button {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Always show Add to Quote button on shop/category pages - FORCE VISIBILITY */
.woocommerce ul.products li.product .add-to-quote-button,
.woocommerce ul.products li.product .ext-add-to-quote-btn,
.woocommerce ul.products li.product button.add-to-quote-button,
.shop-quote.add-to-quote-button,
.woocommerce-LoopProduct-link .add-to-quote-button,
.woocommerce ul.products li.product .button.add-to-quote-button,
.products .product .add-to-quote-button,
.products .product button.add-to-quote-button,
li.product .add-to-quote-button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 12px auto !important;
    width: auto !important;
    max-width: 200px !important;
    text-align: center !important;
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
    transition: none !important;
}

/* Ensure button is visible even without hover */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product .add-to-quote-button {
    position: relative !important;
    transform: none !important;
    transition: none !important;
}

/* Remove any hover-only visibility - OVERRIDE ALL HOVER STATES */
.woocommerce ul.products li.product:hover .add-to-quote-button,
.woocommerce ul.products li.product .add-to-quote-button,
.woocommerce ul.products li.product:not(:hover) .add-to-quote-button,
.products .product:hover .add-to-quote-button,
.products .product:not(:hover) .add-to-quote-button,
li.product:hover .add-to-quote-button,
li.product:not(:hover) .add-to-quote-button {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Force button visibility in all states */
.add-to-quote-button[style*="display: none"],
.add-to-quote-button[style*="visibility: hidden"],
.add-to-quote-button[style*="opacity: 0"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Style the button consistently - STATIC, NO ANIMATIONS */
.shop-quote.add-to-quote-button.button {
    background: linear-gradient(135deg, #FF66C4 0%, #FF4FA3 100%) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px !important;
    box-shadow: 
        0 4px 15px rgba(255, 102, 196, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    cursor: pointer !important;
    transition: none !important;
    transform: none !important;
}

.shop-quote.add-to-quote-button.button:hover {
    transform: none !important;
    box-shadow: 
        0 4px 15px rgba(255, 102, 196, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1) !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #FF66C4 0%, #FF4FA3 100%) !important;
}

/* Text style button */
.shop-quote.add-to-quote-button.text {
    background: none !important;
    color: #FF66C4 !important;
    text-decoration: underline !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    border: none !important;
}

.shop-quote.add-to-quote-button.text:hover {
    color: #FF4FA3 !important;
    text-decoration: none !important;
}

/* Ensure proper spacing in product grid */
.woocommerce ul.products li.product .button-group,
.woocommerce ul.products li.product .product-buttons {
    margin-top: 10px;
    text-align: center;
}

/* Fix for variable products on category pages */
.woocommerce ul.products li.product.product-type-variable .add-to-quote-button {
    display: block !important;
    margin-top: 10px !important;
}

/* Ensure button appears after price */
.woocommerce ul.products li.product .price + .add-to-quote-button {
    margin-top: 10px !important;
}

/* Fix z-index issues */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    position: relative;
    z-index: 1;
}

.woocommerce ul.products li.product .add-to-quote-button {
    position: relative;
    z-index: 2;
}

/* Loading state for category page buttons */
.shop-quote.add-to-quote-button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.shop-quote.add-to-quote-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Override any parent container hiding */
.woocommerce ul.products li.product > *:has(.add-to-quote-button) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for themes that hide buttons in product loops */
.woocommerce ul.products li.product .product-loop-buttons,
.woocommerce ul.products li.product .product-actions,
.woocommerce ul.products li.product .product-buttons,
.woocommerce ul.products li.product .loop-product-buttons,
.woocommerce ul.products li.product .woocommerce-loop-product__buttons {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 5 !important;
}

/* Extra specificity for stubborn themes */
body.archive .woocommerce ul.products li.product .add-to-quote-button,
body.tax-product_cat .woocommerce ul.products li.product .add-to-quote-button,
body.post-type-archive-product .woocommerce ul.products li.product .add-to-quote-button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* NUCLEAR OPTION - Override ALL Kadence theme hover behaviors */
.kadence-theme .woo-archive-action-on-hover .product-action-wrap,
.kadence-theme .woo-archive-action-on-hover .product-action-wrap > *,
.kadence-theme .woo-archive-action-on-hover .product-action-wrap .add-to-quote-button,
body .woo-archive-action-on-hover .product-action-wrap,
body .woo-archive-action-on-hover .product-loop-action {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    position: relative !important;
    bottom: 0 !important;
    display: block !important;
}

/* Fix positioning that hides buttons off-screen */
.woo-archive-action-on-hover .product-action-wrap {
    position: relative !important;
    bottom: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Reset any negative margins or absolute positioning */
.woo-archive-action-on-hover li.product .product-action-wrap,
.woo-archive-action-on-hover li.product .product-loop-action {
    position: relative !important;
    margin: 10px 0 0 0 !important;
    bottom: 0 !important;
    transform: translateY(0) !important;
}

/* Ensure the action wrapper is always visible */
.woocommerce ul.products li.product .product-action-wrap {
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    bottom: 0 !important;
    transform: none !important;
    display: block !important;
    margin-top: 10px !important;
}

/* FINAL OVERRIDE - Target exact theme structure */
.woo-archive-action-on-hover.woo-archive-btn-button li.product .product-action-wrap {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    bottom: auto !important;
    transform: translateY(0) !important;
}

/* Override the negative positioning */
.woo-archive-action-on-hover li.product .product-action-wrap[style*="bottom"] {
    bottom: 0 !important;
}

/* Make sure button container has proper height */
.woo-archive-action-on-hover .product-action-wrap {
    min-height: 50px !important;
    clear: both !important;
}

