/* Галерея карточки товара (зоны клика, курсоры, точки). Вынесено из template-parts/product/product-gallery.php 11.10.2026: печаталось инлайном на каждой странице с этим блоком.
   Подключается <link> на том же месте шаблона — порядок каскада прежний. */

/* Скрываем стрелочки навигации */
.nt-image-nav {
    display: none !important;
}

/* Кастомные курсоры для стрелок влево/вправо */
@keyframes cursor-left {
    0% { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23213377" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>') 12 12, auto; }
}

@keyframes cursor-right {
    0% { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23213377" stroke-width="2"><path d="M5 12h14M12 5l7 7-7 7"/></svg>') 12 12, auto; }
}

/* Зоны клика для ПК версии (3 зоны: левая 30%, центральная 40%, правая 30%) */
.nt-image-click-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
}

.nt-image-click-zone.nt-click-prev {
    left: 0;
    width: 30%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23213377" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>') 12 12, w-resize;
}

.nt-image-click-zone.nt-click-center {
    left: 30%;
    width: 40%;
    cursor: zoom-in;
}

.nt-image-click-zone.nt-click-next {
    right: 0;
    width: 30%;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23213377" stroke-width="2"><path d="M5 12h14M12 5l7 7-7 7"/></svg>') 12 12, e-resize;
}

.nt-image-click-zone:hover {
    /* 09.09.2026: серая подсветка трети кадра под курсором читалась как «фото съехало» — снята */
    background: transparent;
}

/* Навигационные точки для мобильной версии */
.nt-gallery-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    margin-top: 0;
    width: 100%;
    order: 2; /* Размещаем после изображения */
}

/* Щит !important — кит Elementor красит голые button в синий:
   все точки выглядели одинаково синими таблетками */
.nt-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #D1D5DB !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0 !important;
    transition: all 0.3s ease;
}

.nt-dot.nt-active {
    background: #2C3DF5 !important;
    width: 24px !important;
    border-radius: 4px !important;
}

/* Зоны клика для Lightbox */
.nt-lightbox-click-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 10002;
}

.nt-lightbox-click-zone.nt-lightbox-prev {
    left: 0;
    width: 35%; /* Увеличиваем левую зону для более четких границ */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23213377" stroke-width="2"><path d="M19 12H5M12 19l-7-7 7-7"/></svg>') 12 12, w-resize;
}

.nt-lightbox-click-zone.nt-lightbox-center {
    left: 35%; /* Начинается после левой зоны */
    width: 30%; /* Уменьшаем центральную зону для более четких границ */
    cursor: zoom-in;
}

.nt-lightbox-click-zone.nt-lightbox-next {
    right: 0;
    width: 35%; /* Увеличиваем правую зону для более четких границ */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23213377" stroke-width="2"><path d="M5 12h14M12 5l7 7-7 7"/></svg>') 12 12, e-resize;
}

/* Подсветка зон клика в lightbox (ПК версия) - едва заметная */
@media (min-width: 769px) {
    .nt-lightbox-click-zone {
        transition: background 0.2s ease;
    }
    
    .nt-lightbox-click-zone.nt-lightbox-prev:hover {
        background: rgba(33, 51, 119, 0.08); /* Едва заметная подсветка слева */
    }
    
    .nt-lightbox-click-zone.nt-lightbox-next:hover {
        background: rgba(33, 51, 119, 0.08); /* Едва заметная подсветка справа */
    }
    
    .nt-lightbox-click-zone.nt-lightbox-center:hover {
        background: rgba(33, 51, 119, 0.06); /* Едва заметная подсветка центра */
    }
}

/* Мобильная версия - без подсветки */
@media (max-width: 768px) {
    .nt-lightbox-click-zone:hover {
        background: transparent;
    }
}

/* Скрываем зоны клика при зуме, чтобы не мешали pan */
.nt-lightbox-image-container.nt-zoomed .nt-lightbox-click-zone {
    display: none !important;
    pointer-events: none !important;
}

/* Скрываем стрелочки в lightbox */
.nt-lightbox-nav {
    display: none !important;
}

/* Центрирование стрелочек миниатюр */
.nt-thumbnail-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100px;
}

.nt-thumbnail-arrow {
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(100, 116, 139, 0.5) !important;
    flex-shrink: 0;
    padding: 0;
    margin: 0 auto;
    align-self: center;
}

.nt-thumbnail-arrow svg {
    width: 12px;
    height: 8px;
    stroke: currentColor;
    stroke-width: 2.5;
    transition: all 0.2s ease;
}

.nt-thumbnail-arrow:hover:not(.nt-disabled) {
    background: rgba(100, 116, 139, 0.08) !important;
    color: rgba(100, 116, 139, 0.8) !important;
}

.nt-thumbnail-arrow.nt-disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* Стили характеристик — в product-page.css (инженерная таблица 19.07.2026);
   старый дубль здесь перебивал их и возвращал скругления с navy */

/* Мобильная версия */
@media (max-width: 768px) {
    /* Структура для мобильной версии */
    .nt-product-images {
        width: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden !important;
        position: relative !important;
    }
    
    /* Скрываем миниатюры в мобильной версии */
    .nt-thumbnail-sidebar {
        display: none !important;
    }
    
    /* Увеличиваем главное изображение - убираем рамку, тень и увеличиваем */
    .nt-main-image {
        width: 100%;
        aspect-ratio: 1;
        min-height: 280px;
        max-height: none;
        order: 1; /* Изображение первым */
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        overflow: hidden !important;
        position: relative;
    }
    
    .nt-main-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 0;
        transform: scale(1) !important;
        transition: transform 0.2s ease-out !important;
        will-change: transform;
        touch-action: pan-x pan-y;
    }
    
    /* Убираем эффект hover для мобильной версии */
    .nt-main-image:hover img {
        transform: scale(1) !important;
    }
    
    /* Показываем навигационные точки внизу */
    .nt-gallery-dots {
        display: flex;
        order: 2; /* Точки после изображения */
        margin-top: 0;
        margin-bottom: 4px;
    }
    
    /* Скрываем зоны клика в мобильной версии */
    .nt-image-click-zone {
        display: none;
    }
}

/* Видео-слайд в главном окне: play-плашка поверх постера */
.nt-main-video-cue {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* клики идут в центр-зону — она откроет плеер */
    z-index: 2;
}

.nt-main-image.nt-video-slide .nt-main-video-cue {
    display: flex;
}

/* Белая нео-кнопка play: чёрный квадрат глушил фото (реш. 22.07.2026) */
.nt-main-video-cue__btn {
    width: 64px;
    height: 64px;
    background: #fff;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 0 #000;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.nt-main-image.nt-video-slide:hover .nt-main-video-cue__btn {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 0 #000;
}

.nt-main-video-cue__btn svg {
    margin-left: 4px;
}

/* ==================== VIDEO THUMBNAIL (Play overlay) ==================== */
.nt-thumbnail-video {
    position: relative;
}

/* Play — белый нео-квадрат: миниатюрная копия play-кнопки слайда */
.nt-thumbnail-video .nt-video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #fff;
    border: 1.5px solid #000;
    border-radius: 0;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nt-thumbnail-video:hover .nt-video-play-overlay {
    background: #2C3DF5;
    border-color: #2C3DF5;
    color: #fff;
}

.nt-thumbnail-video .nt-video-play-overlay svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

.nt-thumbnail-video img {
    filter: brightness(0.85);
    transition: filter 0.2s ease;
}
.nt-thumbnail-video:hover img {
    filter: brightness(1);
}

/* ==================== VIDEO LIGHTBOX ==================== */
.nt-video-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.nt-video-lightbox.is-open {
    display: flex;
}

/* Крестик — голый технический, белый на тёмном оверлее (реш. 22.07.2026) */
.nt-video-lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: #fff;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}
.nt-video-lightbox-close:hover {
    background: none;
    opacity: 0.65;
}

.nt-video-lightbox-content {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 80px);
    background: #000;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    position: relative;
}

.nt-video-lightbox-content iframe,
.nt-video-lightbox-content video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Счётчик просмотров — тихая Unbounded-подпись на видео */
.nt-video-views {
    position: absolute;
    left: 14px;
    bottom: 60px; /* над контролами плеера */
    font-family: 'Unbounded', 'Montserrat', sans-serif !important;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.55);
    padding: 5px 8px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .nt-video-lightbox {
        padding: 20px 8px;
    }
    .nt-video-lightbox-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}

/* ПК версия */
@media (min-width: 769px) {
    /* Скрываем точки в ПК версии */
    .nt-gallery-dots {
        display: none !important;
    }
    
    /* Показываем миниатюры в ПК версии */
    .nt-thumbnail-sidebar {
        display: flex;
    }
    
    /* Убираем рамки и увеличиваем изображение в ПК версии */
    .nt-main-image {
        cursor: zoom-in;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }
    
    /* 09.09.2026: зум ×1.2 снят. Он «увеличивал» рендеры с широкими белыми полями, но при
       overflow:hidden срезал по 8% с каждой стороны у любого плотного кадра — 50 обложек из 77
       (BM054, EMS31, BMFR25…). Поля теперь нормализуются в самих файлах (объект ≈ 88% кадра). */
    .nt-main-image img {
        padding: 5px !important;
        transform: none !important;
        transition: none !important;
    }
    
    /* Убираем эффект hover для ПК версии */
    .nt-main-image:hover img {
        transform: none !important;
    }
    
    .nt-main-image .nt-click-center {
        cursor: zoom-in;
    }
}
