/* 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;
}

/* Основной слайдер */
.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 {
    width: 60px !important;
    height: 60px;
    flex-shrink: 0;
    opacity: 0.5;
    cursor: pointer;
    border: 2px solid #eee;
    border-radius: 4px;
    transition: all 0.3s;
}

.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-color: #afdef3 !important;
    border-width: 2px !important;
    border-style: solid !important;
    transform: scale(1.03) !important;
    box-shadow: 0 2px 4px rgba(175, 222, 243, 0.2) !important;
}

/* Неактивные миниатюры - полупрозрачные, светлая рамка */
.thumbsSwiper .thumb-slide {
    opacity: 0.6 !important;
    border: 2px solid #eee !important;
    transition: all 0.2s ease !important;
}

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

/* Кнопки навигации */
#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.35 !important;
    pointer-events: none !important;
    cursor: default !important;
}

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

/* Когда 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 .thumb-slide.active {
    opacity: 1 !important;
    border-color: #88ceeb !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 6px rgba(235, 111, 75, 0.3) !important;
}

.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;
}

/* Более агрессивный фикс для крутилок */
.swiper-button-next.btn-next1,
.swiper-button-prev.btn-prev1 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !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;
}

/* Или через table-cell для старых браузеров */
.btn-next1,
.btn-prev1 {
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: center !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: 95% !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;
    }
}



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

#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;
    max-height: 60vh !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: 50px !important;
    height: 50px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    border: 2px 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-thumb.active {
    opacity: 1 !important;
    border-color: #afdef3 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 3px 8px rgba(175, 222, 243, 0.4) !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;
}