/* ============================================
   single-product: одноколоночная (stacked) верстка
   записей рубрик «Оборудование» (29) и «Запчасти» (39)
   ============================================ */

.single-product {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
    margin-bottom: 40px;
}

/* Принудительно сохраняем колонку на всех разрешениях,
   перебивая правила двухколоночного .post-layout из style.css. */
@media (min-width: 768px) {
    .single-product {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Медиа (главное фото + слайдер) --- */

.single-product__media {
    width: 100%;
    max-width: 100%;
}

.single-product__slider {
    position: relative;
    margin: 0 0 32px;
}

.single-product__slider-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 10%;
    scroll-padding-inline: 10%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.single-product__slider-track::-webkit-scrollbar {
    display: none;
}

.single-product__slide {
    flex: 0 0 80%;
    height: min(500px, 65vh);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: #f5f7fa;
    box-shadow: 0 8px 24px rgba(52, 73, 94, 0.1);
    scroll-snap-align: center;
    cursor: zoom-in;
}

.single-product__slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
}

.single-product__slider-track:focus-visible {
    outline: 2px solid #e67e22;
    outline-offset: -2px;
}

.single-product__main-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7fa;
}

.single-product__main-image img {
    width: 100%;
    max-width: 100%;
    display: block;
    height: min(500px, 65vh);
    border-radius: 12px;
    object-fit: cover;
    background: #f5f7fa;
}

.single-product__slider-button {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid #e0e4e8;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #34495e;
    font-size: 22px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.single-product__slider-button:hover {
    border-color: #e67e22;
    background: #e67e22;
    color: #fff;
}

.single-product__slider-button:focus-visible,
.single-product__slider-dot:focus-visible {
    outline: 2px solid #34495e;
    outline-offset: 3px;
}

.single-product__slider-button--prev {
    left: 2%;
}

.single-product__slider-button--next {
    right: 2%;
}

.single-product__slider-dots {
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 50%;
    display: flex;
    gap: 10px;
    align-items: center;
    transform: translateX(-50%);
}

.single-product__slider-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(52, 73, 94, 0.35);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.single-product__slider-dot.is-active {
    transform: scale(1.3);
    background: #e67e22;
}

.single-product__lightbox {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 56px 24px 24px;
    background: rgba(20, 24, 30, 0.62);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.single-product__lightbox.is-open,
.single-product__lightbox.active {
    display: flex;
}

body.single-product-lightbox-open {
    overflow: hidden;
}

.single-product__lightbox-image {
    display: block;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 80px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.single-product__lightbox-close {
    position: absolute;
    top: 12px;
    right: 18px;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.single-product__lightbox-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* --- Контент --- */

.single-product__content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.single-product__content > .single-product__title {
    margin-top: 0;
}

.single-product__title {
    margin: 0 0 24px;
    font-size: 32px;
    line-height: 1.25;
}

.single-product__text {
    width: 100%;
    max-width: 100%;
}

.single-product__text > * {
    max-width: 100%;
}

@media (max-width: 600px) {
    .single-product {
        gap: 24px;
    }

    .single-product__title {
        font-size: 26px;
    }

    .single-product__slider-track {
        gap: 12px;
        padding-inline: 5%;
        scroll-padding-inline: 5%;
    }

    .single-product__slide {
        flex-basis: 85%;
    }

    .single-product__slide {
        height: min(500px, 65vh);
    }

    .single-product__slider-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .single-product__slider-button--prev {
        left: 12px;
    }

    .single-product__slider-button--next {
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .single-product__slider-track {
        scroll-behavior: auto;
    }
}
