/* Страница детализации */
.container_type_detail {
    width: 80%;
    padding: 10px 0 0 0;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
    border-bottom: 1px solid var(--primary);
    border-right: 1px solid var(--primary);
    border-bottom-right-radius: 1.5rem;
    box-shadow: 6px 3px 8px rgba(253, 186, 1, 0.3);
    padding: 20px 0;
}

/* Галерея */
.product-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    width: 100%;
}

.gallery-slider {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-slider-wrapper {
    display: flex;
    transition: transform 0.3s ease-out;
    touch-action: pan-y pinch-zoom;
    width: 100%;
}

.gallery-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-slide img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none; /* чтобы не мешать свайпу */
}

/* Кнопки навигации слайдера */
.slider-prev, .slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.slider-prev:hover, .slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Точки (dots) */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.slider-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

/* Миниатюры */
.thumbnails-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 0; /* убираем лишний отступ */
    flex-wrap: nowrap;
}

.thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
}

.thumbnails img.active {
    border-color: var(--primary);
}

.thumbnails-container {
    overflow-x: auto;
    scroll-behavior: smooth;
    white-space: nowrap;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.thumbnails-container::-webkit-scrollbar {
    height: 4px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 4px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.thumbnails-prev,
.thumbnails-next {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.thumbnails-prev:hover,
.thumbnails-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Скрываем миниатюры на мобильных (опционально) */
@media (max-width: 768px) {
    .thumbnails-slider {
        display: none;
    }
}

/* Информация о товаре */
.product-info {
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: start;
    padding: 0 20px;
    gap: 40px;
}

.info__box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
}

.product-info__value {
    font-size: 1rem;
    display: flex;
    gap: 5px;
    max-width: 50%;
}

/* Выбор цвета */
.color-list {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.color-swatch {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    transition: 0.2s;
    overflow: hidden;
}

.color-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.color-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary);
}

/* Размеры */
.size-select {
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    min-width: 100px;
}

.size-select:hover {
    cursor: pointer;
}

.selected-price {
    margin-top: 0.5rem;
    font-weight: bold;
}

/* Характеристики */
.parameters {
    max-width: 80%;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.parameters ul {
    list-style: none;
    padding: 0;
}

.parameters li {
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .container_type_detail {
        width: 95%;
    }
    .product-detail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .product-gallery {
        min-width: 100%;
    }
    .product-info {
        padding-bottom: 20px;
    }
    .parameters {
        max-width: 100%;
    }
    .gallery-slide img {
        max-height: 55vh; /* чуть меньше на мобильных */
    }
}

/* Для десктопа можно задать фиксированную высоту слайдера по желанию */
@media (min-width: 769px) {
    .gallery-slider {
        height: auto;
    }
}