/* Frontend Styles for Shoppable Images */

.shoppable-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 0;
}

.shoppable-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.shoppable-image {
    max-width: 100%;
    height: auto;
    display: block;
    /* border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); */
}

/* Hotspots */
.hotspot {
    position: absolute;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shoppable-image-wrapper:hover .hotspot {
    opacity: 1;
}

.hotspot-dot {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff4444;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
    animation: pulse 2s infinite;
    transition: transform 0.2s ease;
}

.hotspot:hover .hotspot-dot {
    transform: scale(1.2);
    background: #ff6666;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    51%, 100% {
        opacity: 0.7;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 8px rgba(255, 68, 68, 0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 10px rgba(255, 68, 68, 0);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Tooltip */
.hotspot-tooltip {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
    min-width: 280px;
    max-width: 320px;
    border: 1px solid #e0e0e0;
}

.hotspot-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-content {
    padding: 0;
}

.tooltip-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.tooltip-product {
    display: flex;
    padding: 15px;
    gap: 15px;
}

.tooltip-product .product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.tooltip-product .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tooltip-product .product-info {
    flex: 1;
    min-width: 0;
}

.tooltip-product .product-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tooltip-product .product-price {
    margin: 0 0 12px 0;
    font-family: var(--font-title);
    font-size: 22px;
    color: var(--secondary);
    margin-bottom: 20px;
}

.tooltip-product .product-price del {
    display: none !important;
}
.tooltip-product .product-price ins{
    text-decoration: none !important;
}

.tooltip-arrow {
    display: none;
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-arrow::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #e0e0e0;
    top: -1px;
    left: -9px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .shoppable-image-container {
        margin: 15px 0;
    }
    
    .hotspot {
        width: 28px;
        height: 28px;
        margin-left: -14px;
        margin-top: -14px;
        opacity: 1; /* Always visible on mobile */
    }
    
    .hotspot-dot {
        width: 28px;
        height: 28px;
    }
    
    /* .hotspot-tooltip {
        min-width: 260px;
        max-width: 90vw;
        position: fixed;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .hotspot-tooltip.show {
        transform: translate(-50%, -50%) !important;
    } */
    
    .tooltip-arrow {
        display: none;
    }
    
    .tooltip-product {
        flex-direction: column;
        text-align: center;
    }
    
    .tooltip-product .product-image {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .tooltip-product .product-title {
        font-size: 18px;
    }
    
    .tooltip-product .product-price {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    /* .hotspot-tooltip {
        max-width: 95vw;
        margin: 10px;
    } */
    
    .tooltip-product {
        padding: 12px;
    }
    
    .tooltip-product .product-image {
        width: 80px;
        height: 80px;
    }
    
    .tooltip-product .product-title {
        font-size: 16px;
    }
    
    .tooltip-product .product-price {
        font-size: 18px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .hotspot {
        opacity: 1;
    }
    
    .hotspot-dot {
        animation-duration: 3s;
    }
    
    .hotspot:active .hotspot-dot {
        transform: scale(0.9);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hotspot-dot {
        box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
}

/* Accessibility */
.hotspot:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.hotspot:focus .hotspot-dot {
    transform: scale(1.2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hotspot-dot {
        animation: none;
    }
    
    .hotspot,
    .hotspot-tooltip,
    .hotspot-dot,
    .product-link {
        transition: none;
    }
}