/* Product Image Zoom Styles */
.img-magnifier-container {
    position: relative;
    cursor: zoom-in;
}

/* Resim yoksa: container içinde sadece "Fotoğraf yok" */
.img-magnifier-container.product-no-image {
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    cursor: default;
}
.img-magnifier-container.product-no-image .image-zoom-icon {
    display: none !important;
}
.product-no-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 280px;
    display: none;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #374151;
    font-size: 1.125rem;
    font-weight: 600;
    z-index: 5;
}
.product-no-image-placeholder.show {
    display: flex !important;
}
.img-magnifier-container.product-no-image .product-no-image-placeholder.show {
    display: flex !important;
}
.img-magnifier-container.product-no-image img#main-product-image {
    display: none !important;
}
.img-magnifier-container:has(.product-no-image-placeholder.show) {
    cursor: default;
}
.img-magnifier-container:has(.product-no-image-placeholder.show) .image-zoom-icon {
    display: none;
}
/* Resim yokken hiçbir loading/spin animasyonu olmasın */
.product-no-image .loading-indicator,
.product-main-image.product-no-image .loading-indicator,
.img-magnifier-container.product-no-image ~ .loading-indicator {
    display: none !important;
    animation: none !important;
}
.product-no-image-placeholder,
.product-no-image-placeholder.show {
    animation: none !important;
}
/* Thumbnail kutularındaki loading: resim yüklenemezse titremesin */
.thumbnail-item .loading-indicator {
    animation: none;
}
/* Thumbnail kutusunda resim yoksa: sadece metin, animasyon yok */
.thumb-no-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    animation: none !important;
}
.thumbnail-item {
    position: relative;
}

.img-magnifier-glass {
    position: absolute;
    border: 3px solid var(--pd-primary, #00b3c7);
    border-radius: 50%;
    cursor: none;
    width: 150px;
    height: 150px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    z-index: 100;
    pointer-events: none;
}

.product-main-image:hover .img-magnifier-glass {
    display: block;
}

.image-zoom-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 15;
}

.image-zoom-icon:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.image-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
    z-index: 15;
}

.image-navigation .nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.image-navigation .nav-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--pd-primary, #00b3c7);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.product-main-image.loading .loading-indicator {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==================== LIGHTBOX STYLES ==================== */
.product-lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.product-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.product-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.product-lightbox-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.product-lightbox-button {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    font-size: 20px;
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.product-lightbox-button:hover {
    background: #fff;
    transform: scale(1.1);
}

.product-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff4444;
    color: #fff;
    z-index: 1000000;
}

.product-lightbox-close:hover {
    background: #ff0000;
}

.product-lightbox-prev {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.product-lightbox-next {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.product-lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
}

/* Mobile Lightbox */
@media (max-width: 768px) {
    .product-lightbox-button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .product-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .product-lightbox-prev {
        left: 10px;
    }
    
    .product-lightbox-next {
        right: 10px;
    }
    
    .product-lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }
}
