/* ============================================
   Featured Products - Gallery Modal Styles
   Image cards, modal gallery, zoom
   ============================================ */

/* ========== Featured Modal Overlay ========== */
.featured-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-loading {
    color: #fff;
    font-size: 18px;
    text-align: center;
    padding: 60px;
}

/* ========== Gallery Modal Layout ========== */
.gallery-modal {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    color: #fff;
}

.gallery-counter {
    font-size: 14px;
    opacity: 0.8;
}

.gallery-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.gallery-close:hover {
    opacity: 1;
}

/* ========== Gallery Body ========== */
.gallery-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    gap: 10px;
}

.gallery-image-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-height: 100%;
    position: relative;
    cursor: zoom-in;
}

.gallery-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-image:hover {
    /* Hover zoom hint - subtle scale on PC */
    transform: scale(1.02);
}

.gallery-caption {
    color: #fff;
    text-align: center;
    font-size: 15px;
    padding: 12px 20px;
    opacity: 0.9;
    max-width: 80%;
    margin-top: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
}

/* ========== Gallery Navigation ========== */
.gallery-nav {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 15px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.gallery-nav:hover {
    background: rgba(255,255,255,0.25);
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ========== Thumbnails ========== */
.gallery-thumbnails {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 15px 0;
    overflow-x: auto;
    flex-shrink: 0;
}

.gallery-thumb {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.gallery-thumb:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.gallery-thumb.active {
    opacity: 1;
    border-color: #4f8cff;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== Zoom Controls ========== */
.gallery-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
    flex-shrink: 0;
}

.gallery-zoom-controls button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.gallery-zoom-controls button:hover {
    background: rgba(255,255,255,0.3);
}

.gallery-zoom-controls span {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* ========== Video Gallery ========== */
.video-gallery {
    overflow-y: auto;
}

.video-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    padding: 10px 0;
}

.video-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: hidden;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-caption {
    color: #fff;
    padding: 12px 15px;
    font-size: 14px;
    opacity: 0.9;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .gallery-modal {
        padding: 10px;
    }

    .gallery-image {
        max-height: 55vh;
    }

    .gallery-nav {
        padding: 10px 8px;
        font-size: 18px;
    }

    .gallery-thumbnails {
        padding: 10px 0;
    }

    .gallery-thumb {
        width: 50px;
        height: 38px;
    }

    .gallery-caption {
        font-size: 13px;
        max-width: 95%;
        padding: 10px 15px;
    }

    .video-gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-zoom-controls button {
        padding: 10px 12px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-image {
        max-height: 45vh;
    }

    .gallery-thumb {
        width: 40px;
        height: 30px;
    }

    .gallery-nav {
        padding: 8px 6px;
        font-size: 14px;
    }
}