﻿/* ==========================================================================
   PRODUCT DETAILS PAGE STYLES (Mobile-First)
   Зависит от токенов из global.css (--p700, --b700, --radius-btn и т.д.)
   ========================================================================== */



/* --- LAYOUT --- */
.product-details-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 48px;
}

/* --- GALLERY (Touch-Slider & Soft Rounded Style) --- */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* Главный контейнер фото без рамок с мягким фоном */
.gallery-viewport {
    width: 100%;
    border-radius: 16px;
    border: none;
    
    overflow: hidden;
}

.gallery-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .gallery-track::-webkit-scrollbar {
        display: none;
    }

.gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 1 / 1;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    .gallery-slide img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
        user-select: none;
        pointer-events: none;
    }

/* Мобильные точки (Dots) */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--b400);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

    .gallery-dot.is-active {
        background-color: var(--p700);
        width: 20px;
        border-radius: 4px;
    }

/* Миниатюры без рамок */
.thumbnail-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.thumbnail {
    width: 60px;
    height: 60px;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 12px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

    .thumbnail img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 6px;
    }

    /* Активное состояние миниатюры (без шва и сдвигов layout) */
    .thumbnail.is-active {
        background-color: var(--b100);
        box-shadow: 0 0 0 2px var(--p700);
    }



/* --- INFO SECTION --- */
.product-info {
    min-width: 0;
    width: 100%;
}

.p-meta {
    display: inline-block;
    background-color: var(--p100);
    color: var(--p700);
    padding: 4px 12px;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.p-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--b700);
    margin: 0 0 16px 0;
    line-height: 1.25;
}

/* --- DESCRIPTION --- */
.p-desc {
    font-size: 16px;
    color: var(--b600);
    line-height: 1.75;
    margin-bottom: 8px;
    overflow-wrap: break-word;
}

    .p-desc.content-clamped {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.show-more-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--b700);
    cursor: pointer;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

    .show-more-btn:hover {
        color: var(--p700);
        text-decoration: underline;
    }

/* --- ACCORDION --- */
.p-accordion {
    border-top: 1px solid var(--b300);
}

.p-accordion-title {
    margin: 0;
    font-size: inherit;
}

.p-accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--b700);
    cursor: pointer;
    text-align: left;
}

.p-accordion .chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.p-accordion.is-open .chevron {
    transform: rotate(180deg);
}

.p-accordion-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.p-accordion.is-open .p-accordion-body {
    grid-template-rows: 1fr;
}

.p-accordion-content {
    overflow: hidden;
}

/* --- TECH SPECS LIST --- */
.spec-list {
    margin: 0;
    padding-bottom: 16px;
}

.spec-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--b200);
}

    .spec-row:last-child {
        border-bottom: none;
    }

.spec-label {
    font-size: 14px;
    color: var(--b500);
}

.spec-value {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--b700);
    word-break: break-word;
}

/* --- APPLICATIONS --- */
.product-applications {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--b300);
}

.section-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--b700);
}

.application-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.app-tag {
    background-color: var(--p100);
    color: var(--p700);
    padding: 6px 12px;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 600;
}

/* --- ACCESSIBILITY FOCUS STATES --- */
.thumbnail:focus-visible,
.show-more-btn:focus-visible,
.p-accordion-header:focus-visible,
.crumb-link:focus-visible {
    outline: 2px solid var(--p700);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- DESKTOP BREAKPOINT --- */
@media (min-width: 992px) {
    .product-details-layout {
        grid-template-columns: 1fr 1fr;
        gap: 48px;
        padding-bottom: 80px;
    }

    .product-gallery {
        gap: 16px;
    }

    .gallery-slide {
        padding: 24px;
    }

    .gallery-pagination {
        display: none;
    }

    .thumbnail {
        width: 80px;
        height: 80px;
    }

    .spec-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
    }

    .spec-label {
        width: 35%;
    }

    .spec-value {
        text-align: right;
        flex: 1;
    }
}
