/**
 * Wisteria Sold Badge Stylesheet - Collection & Single Product Gallery Integration
 */

@keyframes wisteriaBadgeFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Pill Badge Base Style */
.wisteria-sold-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #111111 !important;
    color: #FFFFFF !important;
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    border-radius: 999px !important;
    padding: 8px 18px !important;
    line-height: 1 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    pointer-events: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    animation: wisteriaBadgeFadeIn 0.4s ease-out forwards !important;
    position: absolute !important;
    z-index: 99 !important;
}

/* Position on Collection Cards / Archives / Shop / Elementor Product Grids */
.product .wisteria-sold-badge.archive-badge,
ul.products li.product .wisteria-sold-badge.archive-badge,
.woocommerce ul.products li.product .wisteria-sold-badge.archive-badge,
.elementor-widget-woocommerce-products .wisteria-sold-badge.archive-badge,
.type-product .wisteria-sold-badge.archive-badge,
.e-loop-item .wisteria-sold-badge.archive-badge,
.wisteria-is-sold .wisteria-sold-badge.archive-badge {
    top: 20px !important;
    left: 20px !important;
}

/* Single Product Gallery Image Container Position */
.wisteria-product-image-wrapper,
.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__image {
    position: relative !important;
}

.wisteria-sold-badge.single-gallery-badge {
    top: 16px !important;
    left: 16px !important;
    z-index: 999 !important;
}

/* Product Card Container Position Context */
.woocommerce ul.products li.product,
ul.products li.product,
.woocommerce-loop-product__link,
.product-type-simple,
.product-type-variable,
.product,
.e-loop-item,
.elementor-widget-theme-post-featured-image {
    position: relative;
}

/* Reduced Image Brightness to ~90% for Sold Items */
.product.outofstock img,
.wisteria-is-sold img,
.product.outofstock .woocommerce-LoopProduct-link img,
.product.outofstock .attachment-woocommerce_thumbnail,
.single-product.outofstock .woocommerce-product-gallery__image img,
.single-product.outofstock .wp-post-image {
    filter: brightness(0.9) !important;
    transition: filter 0.3s ease !important;
}

/* Disabled "Sold Out" Button Styling */
.single-product.outofstock .single_add_to_cart_button,
.product.outofstock .add_to_cart_button,
.wisteria-is-sold .add_to_cart_button,
.single-product.outofstock button.button.alt,
button.single_add_to_cart_button.disabled,
a.button.product_type_simple.add_to_cart_button.disabled {
    background-color: #e5e5e5 !important;
    color: #888888 !important;
    border-color: #e5e5e5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.7 !important;
    box-shadow: none !important;
}

/* Suppress Default Out of Stock text */
.stock.out-of-stock,
p.stock.out-of-stock,
.woocommerce-variation-availability p.stock.out-of-stock {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .wisteria-sold-badge {
        font-size: 12px !important;
        padding: 6px 14px !important;
        letter-spacing: 1.5px !important;
    }
    
    .product .wisteria-sold-badge.archive-badge,
    ul.products li.product .wisteria-sold-badge.archive-badge,
    .e-loop-item .wisteria-sold-badge.archive-badge {
        top: 14px !important;
        left: 14px !important;
    }

    .wisteria-sold-badge.single-gallery-badge {
        top: 12px !important;
        left: 12px !important;
    }
}