/* swiper-custom.css */

/* Скрываем неинициализированный Swiper */
.productSwiper:not(.swiper-initialized),
.thumbsSwiper:not(.swiper-initialized) {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* После инициализации - показываем */
.productSwiper.swiper-initialized,
.thumbsSwiper.swiper-initialized {
    opacity: 1;
    visibility: visible;
    height: auto;
    transition: opacity 0.3s ease;
}

/* Контейнер слайдера */
.prodRatioHolder {
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;	
}

/* Основной слайдер */
.productSwiper {
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.productSwiper .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.productSwiper .swiper-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.productSwiper img {
    max-height: 480px;
    max-width: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Миниатюры */
.thumbsSwiper {
    height: 100px;
    margin-top: 15px;
    overflow: hidden;
}

.thumbsSwiper .swiper-wrapper {
    display: flex;
    justify-content: center;
}

.thumbsSwiper .swiper-slide.active {
    opacity: 1;
    border-color: #EB6F4B;
}

.thumbsSwiper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}
/* Активная миниатюра - голубая рамка */
.thumbsSwiper .thumb-slide.active {
    opacity: 1 !important;
    border-width: 1px !important;
    border-style: solid !important;
    transform: scale(1) !important;
    box-shadow: 0 2px 4px rgba(175, 222, 243, 0.2) !important;
}


/* Ховер на миниатюрах */
.thumbsSwiper .thumb-slide:hover {
    opacity: 0.8 !important;
    border-color: #ddd !important;
}


div.swiper-button-next,
div.swiper-button-prev {
    -moz-border-radius: 100%;
    -webkit-border-radius: 100%;
    border-radius: 100%;
    width: 42px;
    height: 42px;
    background-color: #f0f3f5;
    background-image: none !important;
    text-align: center;
    font-size: 30px;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
}

div.swiper-button-next i.fa.fa-angle-right,
div.swiper-button-prev i.fa.fa-angle-left {
    display: none;
}

/* Общие стили для стрелок в табах */
 .swiper-button-prev,
.swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Ховер эффект */
 .swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}





/* Кнопки навигации */
#product-next,
#product-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(240, 243, 245, 0.8);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
}

#product-prev {
    left: 10px;
}

#product-next {
    right: 10px;
}

#product-next:hover,
#product-prev:hover {
    background: #f9d500;
}

/* Для мобильных */
@media (max-width: 767px) {
    .prodRatioHolder {
        height: 400px;
    }
    
    .productSwiper {
        height: 400px;
    }
    
    .productSwiper img {
        max-height: 380px;
    }
}

/* Полностью скрываем прелоадеры */
.swiper-lazy-preloader,
.swiper-lazy-preloader-white {
    display: none !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* Состояние отключено */
.swiper-button-disabled {
    opacity: 0 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Скрываем слайдеры до инициализации */
.productSwiper,
.thumbsSwiper {
    opacity: 0;
    visibility: hidden;
}

/* Когда Swiper готов — показываем плавно */
.swiper-initialized {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.3s ease;
}

/* Обёртка миниатюр */
.thumbsSwiper .swiper-wrapper {
    transition-duration: 0ms !important;
    transform: translate3d(0px, 0px, 0px) !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin: 20px auto 0 !important;
    width: 80% !important;
}

/* Один слайд миниатюры */
.thumbsSwiper .thumb-slide {
    width: 60px !important;
    height: 60px !important;
    margin: 4px !important;
    border: 2px solid #eee !important;
    border-radius: 4px !important;
    opacity: 0.5 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

/* Внутреннее изображение */
.thumbsSwiper .thumb-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thumbsSwiper .thumb-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


.thumbsSwiper .swiper-slide:hover {
    opacity: 0.8;
}

/* 1. Убираем стандартные стрелки Swiper */
.swiper-button-next::after,
.swiper-button-prev::after {
    content: "" !important;
    display: none !important;
}

/* 2. Если внутри есть .fa - показываем её */
.swiper-button-next .fa,
.swiper-button-prev .fa {
    display: block !important;
    font-size: 24px !important;
}

/* 3. Если внутри НЕТ .fa - создаем псевдоэлемент */
.swiper-button-next:not(:has(.fa))::before {
    content: "\f105" !important; /* fa-angle-right */
    font-family: 'FontAwesome' !important;
    font-size: 24px !important;
    color: #333 !important;
}

.swiper-button-prev:not(:has(.fa))::before {
    content: "\f104" !important; /* fa-angle-left */
    font-family: 'FontAwesome' !important;
    font-size: 24px !important;
    color: #333 !important;
}

/* 4. Стили для галереи товара */
#product-next,
#product-prev,
#modal-product-next,
#modal-product-prev {
    background: rgba(240, 243, 245, 0.8) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
}

#product-next:hover,
#product-prev:hover,
#modal-product-next:hover,
#modal-product-prev:hover {
    background: #f9d500 !important;
}



/* Скрываем стрелки неактивных табов */
.tab-pane:not(.active) .swiper-button-prev,
.tab-pane:not(.active) .swiper-button-next {
    display: none !important;
}

/* Позиционирование стрелок для табов */
.tab-pane.active .swiper-button-prev,
.tab-pane.active .swiper-button-next {
    display: flex !important;
}


.swiper-button-next.btn-next1 .fa,
.swiper-button-prev.btn-prev1 .fa {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 auto !important;
    display: block !important;
}



/* ============================================
   ВЕРТИКАЛЬНОЕ ЦЕНТРИРОВАНИЕ СЛАЙДОВ
   ============================================ */

/* Контейнер слайдера */
.productSwiper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 500px !important;
}

/* Обертка слайдов */
.productSwiper .swiper-wrapper {
    display: flex !important;
    align-items: center !important; /* Ключевое: центрирование по вертикали */
    height: 100% !important;
}

/* Каждый слайд */
.productSwiper .swiper-slide {
    display: flex !important;
    align-items: center !important; /* Центрирование содержимого */
    justify-content: center !important;
    height: auto !important; /* Автоматическая высота */
    min-height: 0 !important;
}

/* Внутренний контейнер слайда */
.productSwiper .slide-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 480px !important; /* Максимальная высота как у изображения */
}

/* Изображение внутри слайда */
.productSwiper .product-slide-image {
    max-height: 480px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important; /* Центрирование по горизонтали */
}

/* Для мобильных */
@media (max-width: 767px) {
    .productSwiper {
        height: 400px !important;
    }
    
    .productSwiper .slide-inner {
        max-height: 380px !important;
    }
    
    .productSwiper .product-slide-image {
        max-height: 380px !important;
    }
}

/* Стили для индикатора свайпа - ИСПРАВЛЕНО */
.swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%; /* Добавить - центрирование по горизонтали */
    transform: translate(-50%, -50%); /* Добавить - точное центрирование */
    width: 50px;
    height: 50px;
    background: rgba(175, 222, 243, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.swipe-indicator::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(175, 222, 243, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(175, 222, 243, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(175, 222, 243, 0);
    }
}


.product-slide-video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    background: #000;
}

/* Видео-значок для основного слайда */
.video-slide-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(175, 222, 243, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    z-index: 5;
    opacity: 0.8;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.video-slide-badge:hover {
    background: rgba(175, 222, 243, 1);
    transform: scale(1.1);
    opacity: 1;
}

/* Видео-значок для миниатюр */
.thumb-slide[data-type="video"] .video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Центрирование */
    width: 30px;
    height: 30px;
    background: rgba(175, 222, 243, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 2;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.thumb-slide[data-type="video"]:hover .video-badge {
    background: rgba(175, 222, 243, 1);
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}


/* ============================================
   КНОПКА ГАЛЕРЕИ И ЛАЙТБОКС
   ============================================ */

#product-gallery-btn {
    animation: pulse 5s infinite; /* Стало: 10 секунд (в 5 раз медленнее) */
}

@keyframes pulse {
        0% { box-shadow: 0 0 0 0 rgba(108, 117, 125, 0.4); }
        70% { box-shadow: 0 0 0 10px rgba(108, 117, 125, 0); }
        100% { box-shadow: 0 0 0 0 rgba(108, 117, 125, 0); }
        }

/* Лайтбокс */
.product-lightbox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.product-lightbox[style*="display: block"] {
    opacity: 1;
    visibility: visible;
}

.lightbox-thumb:hover {
    opacity: 0.8 !important;
    transform: scale(1.05);
}

.lightbox-thumb.active {
    opacity: 1 !important;
    border-color: rgba(240, 243, 245, 0.8) !important;
}

/* Адаптивность */
@media (max-width: 768px) {
	
	    .lightbox-thumbs {
        bottom: 50px !important;
        padding: 12px 15px !important;
        max-width: 95% !important;
    }
    
    #product-gallery-btn {
        top: 10px;
        right: 60px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    #lightbox-prev,
    #lightbox-next {
        width: 45px !important;
        height: 45px !important;
        font-size: 20px !important;
    }
}

/* ============================================
   АДАПТИВНЫЙ ЛАЙТБОКС ДЛЯ МОБИЛЬНЫХ
   ============================================ */

#product-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: -webkit-fill-available !important; /* Для iOS Safari */
    background: #fff !important;
    z-index: 9999 !important;
    overflow: hidden !important;
    touch-action: none !important; /* Отключаем жесты браузера */
}

/* Контейнер */
#product-lightbox > div {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 10px !important;
    box-sizing: border-box !important;
}

/* Основное изображение */
#lightbox-main {
    max-width: 95% !important;
    max-height: 60vh !important;
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
}

#lightbox-image {
    max-width: 100% !important;
    object-fit: contain !important;
}

/* Центрированные миниатюры без тени */
.lightbox-thumbs {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    overflow-x: auto !important;
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    /*backdrop-filter: blur(5px) !important; */
    z-index: 1000 !important;
    box-shadow: none !important; /* Убираем тень */
}

.lightbox-thumb {
    width: 70px !important;
    height: 70px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    border: 1px solid #ddd !important;
    opacity: 0.6 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    #lightbox-main {
        max-height: 55vh !important;
    }
    
    #lightbox-image {
        max-height: 55vh !important;
    }
    
    .lightbox-thumb {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Горизонтальная ориентация */
@media (orientation: landscape) and (max-height: 500px) {
    #lightbox-main {
        max-height: 70vh !important;
    }
    
    #lightbox-image {
        max-height: 70vh !important;
    }
    
    #lightbox-thumbs {
        padding: 8px !important;
    }
    
    .lightbox-thumb {
        width: 35px !important;
        height: 35px !important;
    }
}


/* Ховер-эффекты */
#lightbox-next:hover,
#lightbox-prev:hover,
#lightbox-close:hover {
    background: #f9d500 !important;
}

#lightbox-next:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

#lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1) !important;
}

#lightbox-close:hover {
    transform: scale(1.1) !important;
}



/* Зум контейнер */
.swiper-zoom-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.swiper-zoom-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Состояние зума */
.swiper-slide-zoomed .swiper-zoom-container {
    cursor: grab;
}

/* Стили при увеличении */
.swiper-slide-zoomed {
    z-index: 100 !important;
}

/* Подсказка для пользователя */
.swiper-zoom-container::before {
    content: attr(data-zoom-hint);
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

@media (max-width: 768px) {
    .swiper-zoom-container::before {
        content: 'Двойной тап или жест двумя пальцами для зума';
        opacity: 1;
    }
}

/* Скрыть подсказку после первого взаимодействия */
.swiper-zoom-container.active-zoom-hint::before {
    opacity: 0;
    pointer-events: none;
}



/* === ИСПРАВЛЕНИЕ: убираем фиксированную высоту и растягиваем изображение === */

/* Убираем фиксированную высоту у контейнера */
.prodRatioHolder {
    height: auto !important;
    min-height: 400px !important;
    padding: 0 !important;
}

/* Слайдер подстраивается под контент */
.productSwiper {
    height: auto !important;
    min-height: 400px !important;
}

.productSwiper .swiper-wrapper {
    height: auto !important;
}

/* Слайд занимает всю ширину */
.productSwiper .swiper-slide {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Внутренний контейнер слайда */
.productSwiper .slide-inner {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
}

/* Изображение на всю ширину */
.productSwiper img.product-slide-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
}

/* Для мобильных */
@media (max-width: 767px) {
    .prodRatioHolder {
        min-height: 300px !important;
    }
    
    .productSwiper {
        min-height: 300px !important;
    }
}