/* --- Product Modal CSS v4.1 --- */

/* Lightbox Modal - Higher z-index to appear above everything */
#imgLightbox {
    z-index: 1090 !important;
    /* Higher than productDetails (1055) */
}

#imgLightbox .modal-dialog {
    max-width: 100vw;
    margin: 0;
}

#imgLightbox .modal-content {
    background: rgba(0, 0, 0, 0.98) !important;
    border: none !important;
    border-radius: 0 !important;
}

#imgLightbox .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#imgLightboxSrc {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Close button for lightbox */
#imgLightbox .btn-outline-light {
    opacity: 0.8;
    transition: all 0.2s;
    border-width: 2px;
}

#imgLightbox .btn-outline-light:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Details Modal */
#productDetails {
    z-index: 1055 !important;
}

#productDetails .modal-content {
    background: #fff;
}

#detailsImg {
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

#detailsImg:hover {
    transform: scale(1.02);
}

/* Product card interactive states */
.product-image-container {
    cursor: zoom-in;
}

.product-title {
    cursor: pointer;
    transition: color 0.2s ease;
}

.product-title:hover {
    color: var(--primary-color, #FF6B35);
    text-decoration: underline;
}

/* Ensure backdrop layers properly */
.modal-backdrop {
    z-index: 1050;
}

/* When lightbox is open on top of details modal */
#imgLightbox.show~.modal-backdrop,
#imgLightbox+.modal-backdrop {
    z-index: 1085 !important;
}

/* Gallery Thumbnails */
.thumbnails-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.thumbnails-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.details-thumbnail {
    cursor: pointer;
    border: 2px solid transparent;
    /* Prepare for border */
    transition: all 0.2s ease;
    opacity: 0.7;
}

.details-thumbnail:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.details-thumbnail.active {
    opacity: 1;
    border-color: var(--bs-primary) !important;
    transform: scale(1.05);
}

.zoom-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.details-main-image-wrapper:hover .zoom-hint {
    opacity: 1;
}