/* ============================================================
   product-gallery.css — Стили для галереи товаров
   ============================================================ */

/* === ГАЛЕРЕЯ === */




.modern-gallery {
    position: relative;
    max-width: 100%;
    margin: 0 auto 10px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f8f8;
}

.gallery-main-image {
    position: relative;
    width: 100%;
    padding-bottom: 110%; /* ← высота блока (можно менять под свои нужды) */
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-main-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
    transition: opacity 0.3s ease;
}
.gallery-main-image .tags {
    position: absolute;
    z-index: 5;
}
.gallery-main-image .tags.left { top: 10px; left: 10px; }
.gallery-main-image .tags.right { top: 10px; right: 10px; }

.gallery-zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    font-family: Arial, sans-serif;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    font-family: Arial, sans-serif;
    line-height: 1;
}
.gallery-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.gallery-arrow-left { left: 8px; padding: 0px 0px 0px 0px;}
.gallery-arrow-right { right: 8px; padding: 0px 0px 0px 0px;}

.gallery-thumbnails {
    display: flex;
    gap: 6px;
    padding: 10px 5px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
    flex-wrap: nowrap;
    background: #f8f8f8;
    border-top: 1px solid #eee;
}
.gallery-thumbnails::-webkit-scrollbar { height: 4px; }
.gallery-thumbnails::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.gallery-thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    opacity: 0.6;
    background: #fff;
}
.gallery-thumb:hover { opacity: 0.9; transform: scale(1.05); }
.gallery-thumb.active {
    border-color: #4f2a23;
    opacity: 1;
    transform: scale(1.05);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-counter {
    position: absolute;
    bottom: 80px;
    right: 15px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: Arial, sans-serif;
    pointer-events: none;
    user-select: none;
    opacity: 0.7;
}

/* === МОДАЛЬНОЕ ОКНО (LIGHTBOX) === */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: center;
}
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.88);
    cursor: pointer;
}
.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.lightbox-image-container {
    width: 100%;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}
.lightbox-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: lightboxFade 0.25s ease;
}
@keyframes lightboxFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-family: Arial, sans-serif;
    line-height: 1;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-arrow {
	padding: 0px 0px 0px 0px;
    position: absolute;
    top: 33%;
    transform: translateY(0%);
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    line-height: 1;
    backdrop-filter: blur(4px);
    z-index: 20;
}
.lightbox-arrow:hover {
    background: rgba(255,255,255,0.3);
}
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }

.lightbox-counter {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* === АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ === */
@media (max-width: 768px) {
    .gallery-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    .gallery-thumb { width: 50px; height: 50px; }
    .gallery-main-image { padding-bottom: 120%; }
    .gallery-counter { bottom: 70px; font-size: 11px; padding: 2px 10px; }
    .gallery-zoom-hint { font-size: 10px; padding: 3px 10px; bottom: 5px; right: 10px; }

    .lightbox-arrow {
        top: 30%;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    .lightbox-prev { left: -10px; }
    .lightbox-next { right: -10px; }
    .lightbox-close { top: -35px; font-size: 26px; }
    .lightbox-counter { bottom: -30px; font-size: 12px; }
    .lightbox-image-container { height: 75vh; }
}
@media (max-width: 480px) {
    .gallery-thumb { width: 42px; height: 42px; }
    .gallery-thumbnails { gap: 4px; padding: 8px 3px; }
    .gallery-arrow { width: 26px; height: 26px; font-size: 14px; }
    .gallery-main-image { padding-bottom: 130%; }

    .lightbox-arrow {
        top: 28%;
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    .lightbox-image-container { height: 65vh; }
}