/* Gallery Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0;
}

/* Responsive Grid */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f9fa;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Gallery Item Link */
.gallery-item-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Gallery Image */
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* Gallery Item Overlay */
.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gallery-item-subtitle {
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Product link indicator */
.gallery-item[data-has-product="true"]::after {
    content: "🔗";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    z-index: 3;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item[data-has-product="true"]:hover::after {
    opacity: 1;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Video Play Button */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, color 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
    color: #fff;
}

/* Video Modal */
#videoModal .modal-content {
    background-color: #000;
    border: none;
}

#videoModal .modal-header {
    border-bottom: 1px solid #333;
}

#videoModal .modal-title {
    color: #fff;
}

#videoModal .btn-close {
    filter: invert(1);
}

#videoContainer {
    background-color: #000;
}

/* Lightbox Support */
[data-lightbox] {
    cursor: zoom-in;
}

/* Loading State */
.gallery-image[loading="lazy"] {
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Featured Item Badge */
.gallery-item[data-featured="true"]::before {
    content: "Featured";
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffc107;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 3;
    text-transform: uppercase;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.gallery-empty i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

