/**
 * Custom Product Overlay Styles
 * 
 * This file contains styles for custom product overlays that work
 * with existing hover effects without interfering with them.
 */

/* Base overlay styles */
.custom-product-overlay {
    position: absolute;
    display: inline-block;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    pointer-events: none; /* Ensure overlays don't interfere with hover interactions */
    user-select: none;
    transition: all 0.3s ease;
}

/* Position styles */
.custom-product-overlay.position-top-left {
    top: 8px;
    left: 8px;
}

.custom-product-overlay.position-top-right {
    top: 8px;
    right: 8px;
}

.custom-product-overlay.position-bottom-left {
    bottom: 8px;
    left: 8px;
}

.custom-product-overlay.position-bottom-right {
    bottom: 8px;
    right: 8px;
}

/* Style variations */
.custom-product-overlay.style-badge {
    padding: 8px 16px;
    border-radius: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    line-height: 1.2;
    background: none;
    border: none;
    box-shadow: none;
    color: #333333;
    position: relative;
    overflow: visible;
    text-shadow: none;
    min-width: 60px;
    text-align: center;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.custom-product-overlay.style-badge::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: #333333;
    transition: width 0.3s ease;
}

.custom-product-overlay.style-badge:hover::before {
    width: 50px;
}

.custom-product-overlay.style-ribbon {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    position: relative;
    overflow: visible;
    font-weight: 600;
    line-height: 1.2;
    background: none;
    color: #333333;
    box-shadow: none;
    border: none;
    text-shadow: none;
    min-width: 70px;
    text-align: center;
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.custom-product-overlay.style-ribbon::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #333333, transparent);
}

.custom-product-overlay.style-ribbon::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #333333;
}

.custom-product-overlay.style-custom {
    /* Custom styles will be applied via inline styles */
}

/* Size variations */
.custom-product-overlay.size-small {
    font-size: 10px;
    padding: 6px 12px;
    letter-spacing: 1.2px;
}

.custom-product-overlay.size-medium {
    font-size: 12px;
    padding: 8px 16px;
    letter-spacing: 1.5px;
}

.custom-product-overlay.size-large {
    font-size: 14px;
    padding: 10px 20px;
    letter-spacing: 1.8px;
}

/* SVG specific styles */
.custom-product-overlay.overlay-svg {
    background: none;
    padding: 0;
}

.custom-product-overlay.overlay-svg svg {
    max-width: 32px;
    max-height: 32px;
    height: auto;
    display: block;
    filter: none;
}

/* Image file upload styles */
.custom-product-overlay.overlay-image {
    background: none;
    padding: 0;
}

.custom-product-overlay.overlay-image .image-overlay-image {
    max-width: 32px;
    max-height: 32px;
    height: auto;
    display: block;
    filter: none;
    border-radius: 0;
}

/* Ensure overlays don't interfere with hover effects */
.wd-product:hover .custom-product-overlay {
    /* Maintain overlay visibility during hover */
    opacity: 1;
    visibility: visible;
}

/* Ensure overlay doesn't block hover button interactions */
.wd-product .wrapp-buttons,
.wd-product .wd-buttons,
.wd-product .wd-action-btn,
.wd-product .wd-compare-btn,
.wd-product .wrap-wishlist-button,
.wd-product .wrap-quickview-button {
    pointer-events: auto;
    z-index: 25; /* Higher than overlay z-index */
}

/* Specific hover effect compatibility */
.wd-product.wd-hover-icons .custom-product-overlay {
    /* Ensure overlay doesn't interfere with icon hover effects */
    z-index: 10;
}

.wd-product.wd-hover-base .custom-product-overlay {
    /* Ensure overlay stays visible during base hover effect */
    z-index: 15;
}

.wd-product.wd-hover-alt .custom-product-overlay {
    /* Ensure overlay stays visible during alt hover effect */
    z-index: 15;
}

.wd-product.wd-hover-quick .custom-product-overlay {
    /* Ensure overlay stays visible during quick hover effect */
    z-index: 15;
}

.wd-product.wd-hover-button .custom-product-overlay {
    /* Ensure overlay stays visible during button hover effect */
    z-index: 15;
}

/* Specific positioning adjustments for different hover types */
.wd-product.wd-hover-icons .custom-product-overlay.position-top-right {
    /* Adjust position to avoid conflict with action buttons */
    top: 10px;
    right: 10px;
}

.wd-product.wd-hover-base .custom-product-overlay {
    /* Ensure overlay stays visible during base hover effect */
    z-index: 20;
}

.wd-product.wd-hover-alt .custom-product-overlay {
    /* Ensure overlay stays visible during alt hover effect */
    z-index: 20;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-product-overlay {
        font-size: 6px;
        padding: 1px 4px;
    }
    
    .custom-product-overlay.position-top-left,
    .custom-product-overlay.position-top-right {
        top: 3px;
    }
    
    .custom-product-overlay.position-top-left {
        left: 3px;
    }
    
    .custom-product-overlay.position-top-right {
        right: 3px;
    }
    
    .custom-product-overlay.position-bottom-left,
    .custom-product-overlay.position-bottom-right {
        bottom: 3px;
    }
    
    .custom-product-overlay.position-bottom-left {
        left: 3px;
    }
    
    .custom-product-overlay.position-bottom-right {
        right: 3px;
    }
    
    .custom-product-overlay.overlay-svg svg,
    .custom-product-overlay.overlay-image .image-overlay-image {
        max-width: 28px;
        max-height: 28px;
    }
}

/* Animation effects */
.custom-product-overlay {
    animation: cleanFadeIn 0.4s ease-out;
}

@keyframes cleanFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effect for overlay itself (optional) */
.custom-product-overlay:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
    opacity: 0.8;
}

/* Ensure overlay doesn't block product image interactions */
.product-element-top {
    position: relative;
}

.custom-product-overlay {
    /* Ensure overlay is positioned relative to product element top */
    z-index: 15; /* Higher than default labels but lower than hover buttons */
}

/* Compatibility with different product layouts */
.wd-product .product-wrapper .product-element-top {
    position: relative;
}

/* Ensure overlay works with product image links */
.product-image-link {
    position: relative;
    display: block;
}

/* Overlay positioning within product image area */
.product-element-top .custom-product-overlay {
    position: absolute;
}

/* Special handling for products with existing labels */
.custom-product-overlay.position-top-right {
    /* Position opposite to existing HOT/Sale labels */
    top: 8px;
    right: 8px;
    z-index: 20; /* Higher than default product labels */
}

.custom-product-overlay.position-top-left {
    /* Adjust if there are existing labels */
    top: 8px;
    left: 8px;
    z-index: 20; /* Higher than default product labels */
}

/* Ensure overlay doesn't conflict with existing product labels */
.product-labels ~ .custom-product-overlay.position-top-left {
    top: 35px; /* Move down if HOT/Sale label exists */
}

.product-labels ~ .custom-product-overlay.position-top-right {
    top: 8px; /* Stay in top-right, opposite to existing labels */
}

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
    .custom-product-overlay.style-badge {
        box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-product-overlay {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .custom-product-overlay {
        animation: none;
        transition: none;
    }
    
    .custom-product-overlay:hover {
        transform: none;
    }
}

.elementor-panel-state-loading{
    display :none !important;
}
