﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow-x: hidden;
}


img {
    max-width: 100%;
}

.system-body {
    font-family: 'Inter', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 64px;
}

.system-body>section {
    overflow: visible;
}

/* Корень блока «система»: один h1 или h2 на странице (на деталке каталога часто h2) */
.system-body>.system-root-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 48px;
    line-height: 72px;
    margin: 0;
    text-align: center;
}

/* Заголовки секций (подкорень): семантически h2 или h3 — внешний вид один */
.system-section-heading {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 36px;
    line-height: 44px;
    margin: 0;
}

.system-body section+section {
    margin-top: 128px;
}

.system-body p.system-description {
    border-radius: 38px;
    border: 1px solid #000;
    padding: 14px 26px;
    font-weight: 400;
    font-size: 20px;
    line-height: 100%;
    margin: 0 auto;
    margin-top: 11px;
    width: fit-content;
}

.system--items-list {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 56px;
    display: flex;
    flex-direction: column;
    gap: 128px;
}

div.system--items-list {
    gap: 64px;
}

.system-item {
    display: grid;
    grid-template-columns: 336px auto;
    grid-template-rows: repeat(2, auto);
    gap: 24px 32px;
    max-width: 1200px;
}

.item-content-image {
    grid-area: 1 / 1 / 4 / 2;
    max-width: 336px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-content-title {
    grid-area: 1 / 2 / 2 / 2;
}

/* Горизонтальный скролл без видимой полосы: колесо/тачпад/drag (script.js). Правила общие для .gallery и .gallery-thumbs. */
.gallery {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scrollbar-color: transparent transparent;
}

.gallery::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.gallery::-webkit-scrollbar-thumb,
.gallery::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

.gallery-thumbs {
    scrollbar-width: none;
    -ms-overflow-style: none;
    scrollbar-color: transparent transparent;
}

.gallery-thumbs::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.gallery-thumbs::-webkit-scrollbar-thumb,
.gallery-thumbs::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

.gallery-item {
    width: 100%;
    min-width: 100%;
    height: 290px;
    border-radius: 9px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* Десктоп: миниатюры — горизонтальный скролл (полоса скрыта глобально); основная галерея — один кадр без скролла; перетаскивание — в script.js */
@media (min-width: 1024px) {
    .item-content-image .gallery {
        overflow: hidden;
    }

    .gallery-thumbs {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
        padding-right: 10px;
        padding-bottom: 2px;
        overflow-x: auto;
        overflow-y: hidden;
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        touch-action: pan-x;
    }

    .gallery-thumbs.is-dragging {
        cursor: grabbing;
    }

    .gallery-thumb-item {
        flex-shrink: 0;
        min-width: 56px;
        max-width: 56px;
        height: 56px;
        border-radius: 4px;
        overflow: hidden;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
    }

    .gallery-thumb-item img {
        object-fit: cover;
        pointer-events: none;
        -webkit-user-drag: none;
        user-select: none;
    }

    .item-content-image .gallery .gallery-item:not(:first-child) {
        display: none;
    }
}

.item-content-detail {
    width: 100%;
    grid-area: 2 / 2 / 2 / 3;
}

.item-content-title .system-item-heading {
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 36px;
    line-height: 44px;
    margin: 0;
}

.item-content-detail p {
    margin: 0;
    font-family: Inter;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
}

.item-content-elements {
    grid-area: 3 / 2 / 4 / 3;
    display: flex;
    flex-direction: column;
    margin-top: 24px;
}

.item-content-element {
    padding: 15px 10px;
    text-decoration: none;
    color: #000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #C5C5C5;
    border-left: none;
    border-right: none;
    position: relative;
}

.item-content-element:last-child {
    border-bottom: 1px solid #C5C5C5;
}

.item-content-element::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 5px;
    background-image: url('data:image/svg+xml;utf8,<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.999977 8.07107H15.1421M15.1421 8.07107L8.07104 1M15.1421 8.07107L8.07104 15.1421" stroke="%23818181" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    width: 24px;
    height: 24px;
    padding: 5px;
}

.item-content-element .system-link-heading {
    font-weight: 500;
    font-size: 20px;
    line-height: 24px;
    margin: 0;
}

.item-content-element span {
    font-family: Inter;
    font-weight: 400;
    font-size: 16px;
    color: #4C4C4C;
    margin: 0;
    padding: 0 1px;
}

.item-content-element img {
    display: none;
    width: 61px;
    height: 61px;
    object-fit: cover;
    border-radius: 8px;
}

.slide-content-image img {
    max-width: 100%;
}

.system-section-usage {
    overflow: visible;
    width: 100dvw;
    margin-left: calc(50% - 50dvw);
    padding-left: max(0px, calc((100dvw - 1200px) / 2));
}

.system-section-usage .system-section-heading {
    margin-left: 16px;
}

.system-section-usage .system-slider-fullbleed {
    margin-top: 56px;
}

.system-slider-fullbleed {
    box-sizing: border-box;
    /* Owl при autoWidth растягивает .owl-stage на сумму слайдов (напр. 2000px) — без overflow-x
       страница получает горизонтальный скролл. Режем по ширине вьюпорта; «peek» остаётся внутри экрана. */
    max-width: 100dvw;
    overflow: hidden;
}

/* В owl.carousel.min.css у .owl-carousel display:none до класса .owl-loaded — это норма, не переопределять без нужды */
.system--items-slider.system-usage-owl {
    width: 100%;
    max-width: 100%;
}

.system--items-slider.system-usage-owl .owl-stage-outer {
    overflow: visible;
}

.system--items-slider .system-slide {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 387px;
}

.system--items-slider .slide-content-image {
    border-radius: 9px;
    overflow: hidden;
}

.system--items-slider .slide-content-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1.16 / 1;
}

.system--items-slider .slide-content-detail p {
    margin: 0;
    font-family: Inter, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
}

.system--items-slider .owl-nav {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.system--items-slider .owl-nav button.owl-prev,
.system--items-slider .owl-nav button.owl-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #C5C5C5;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    color: #000;
    cursor: pointer;
    padding: 0;
}

.system--items-slider .owl-nav button.owl-prev:hover,
.system--items-slider .owl-nav button.owl-next:hover {
    border-color: #000;
}

.system--items-slider .owl-nav button.owl-prev span,
.system--items-slider .owl-nav button.owl-next span {
    display: block;
    margin-top: -2px;
}

.system-section-trinkets {
    width: 100dvw;
    padding-top: 64px;
    padding-bottom: 64px;
    margin-left: calc(50% - 50dvw);
    padding-left: max(0px, calc((100dvw - 1205px) / 2));
    background: #F1EFED;
    margin-top: 64px;
}

.system-section-trinkets>.system-section-heading {
    margin-top: 9px;
    margin-left: 0;
    margin-bottom: 0;
    padding-right: max(0px, calc((100dvw - 1205px) / 2));
}

ul.system-trinkets-tabs {
    display: flex;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 40px;
    width: 100vw;
    margin-left: calc(100% - 100vw);
    padding-left: max(0px, calc((100vw - 1200px) / 2));
    border-bottom: 2px solid #BEBEBE;
}

ul.system-trinkets-tabs li {
    padding: 16px 10px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    cursor: pointer;
}

ul.system-trinkets-tabs li a {
    font-family: Poppins;
    font-weight: 500;
    font-size: 24px;
    line-height: 24px;
    letter-spacing: 0px;
    color: #898681;
    text-decoration: none;
}

ul.system-trinkets-tabs li.active {
    padding: 16px;
    background: #434343;
    color: #fff;
}

ul.system-trinkets-tabs li.active a {
    color: #fff;
}

.system-trinkets-content {
    margin-top: 34px;
}

.system-trinkets-content-item .system--items-list {
    margin: 0
}

@media (max-width: 1200px) {

    .system-body>.system-root-title {
        margin-top: -10px;
    }

    .system-body {
        max-width: 690px;
        padding-top: 53px;
    }

    .system-body p.system-description {
        margin-top: 15px;
    }

    .system--items-list {
        gap: 141px;
    }

    div.system--items-list {
        padding-top: 40px;
        gap: 32px;
    }

    div.system--items-list .system-section-heading {
        font-size: 30px;
        line-height: 33px;
    }

    .system-item {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .item-content-detail {
        order: 1;
    }

    .item-content-elements {
        order: 3;
        margin-top: 85px;
    }

    div.system--items-list .item-content-elements {
        margin-top: 24px;
    }

    div.system--items-list .item-content-elements .item-content-element {
        border-width: 2px;
        padding: 14px 9px;
    }

    .item-content-image {
        order: 2;
        margin-top: 48px;
        max-width: 100%;
    }

    div.system--items-list .item-content-image {
        order: 1;
        margin-top: 36px;
    }

    /* Полоса кадров: горизонтальный скролл (скроллбар скрыт базовыми правилами .gallery) */
    .gallery {
        gap: 8px;
        width: 100dvw;
        margin-left: calc(50% - 50dvw);
        padding-left: max(0px, calc((100dvw - 690px) / 2));
        padding-right: max(0px, calc((100dvw - 690px) / 2));
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        cursor: grab;
        touch-action: pan-x;
    }

    .gallery.is-dragging {
        cursor: grabbing;
    }

    div.system--items-list .item-content-image .gallery {
        width: 100%;
        margin: 0;
        padding: 0;

    }

    .gallery-item {
        min-width: 310px;
        width: 310px;
        border-radius: 16px;
        flex-shrink: 0;
    }

    div.system--items-list .item-content-image .gallery-item {
        width: 336px;
        min-width: 336px;
        margin: 0 auto;
    }

    .gallery-thumbs {
        display: none;
    }

    .item-content-title .system-item-heading {
        font-size: 32px;
        line-height: 39px;
    }

    .item-content-detail p {
        margin-top: 16px;
        padding-right: 1px;
        max-width: 690px;
    }

    div.system--items-list .item-content-detail p {
        margin-top: 35px;
    }

    .item-content-element {
        padding: 10px;
        display: grid;
        grid-template-columns: 61px auto;
        grid-template-rows: auto;
        gap: 0px 16px;
        align-items: center;
    }

    .item-content-element img {
        grid-area: 1 / 1 / 3 / 2;
        display: block;
    }

    .item-content-element .system-link-heading {
        grid-area: 1 / 2 / 2 / 3;
    }

    .item-content-element span {
        grid-area: 2 / 2 / 2 / 3;
    }

    .system-section-usage .system-section-heading {
        margin-left: 34px;
        margin-top: -5px;
    }

    .system-section-usage {
        padding-left: max(0px, calc((100dvw - 768px) / 2));
    }

    .system-section-usage .system-slider-fullbleed {
        margin-top: 47px;
    }

    .system-section-trinkets {
        padding-left: max(0px, calc((100dvw - 691px) / 2));
    }

    .system-section-trinkets>.system-section-heading {
        margin-top: 4px;
        margin-left: 0;
        margin-bottom: 0;
        text-align: center;
        font-size: 36px;
    }

    .system-trinkets-content {
        margin-top: 50px;
    }

    .system-trinkets-content .item-content-detail {
        order: 3;
        margin-top: 52px;
    }

    .system-trinkets-content .gallery {
        padding-left: max(0px, calc((100dvw - 730px) / 2));
    }

    .system-trinkets-content .item-content-image {
        margin-top: 38px;
        overflow: hidden;
    }

    ul.system-trinkets-tabs {
        margin-top: 30px;
        padding-left: max(0px, calc((100dvw - 704px) / 2));
    }

    .system--items-slider .owl-item .system-slide {
        max-width: 300px;
        box-sizing: content-box;
    }

    .system-trinkets-content .item-content-elements {
        margin-top: 25px;
        max-width: 690px;
    }
}

/* Мобильный: 1 карточка до 300px, дальше — «уезжает» за край экрана */
@media (max-width: 767px) {

    .system-body>.system-root-title {
        font-size: 24px;
        line-height: 36px;
    }

    .system-body {
        max-width: 340px;
    }

    .system--items-list {
        padding-top: 44px;
        gap: 137px;
    }

    .system-body p.system-description {
        font-size: 14px;
        line-height: 17px;
        padding: 7px 16px;
    }

    .item-content-image {
        margin-top: 55px;
    }

    .gallery {
        padding-left: max(0px, calc((100dvw - 340px) / 2));
        padding-right: max(0px, calc((100dvw - 340px) / 2));

    }

    .item-content-image .gallery .gallery-item {
        min-width: 310px;
        width: 310px;
    }



    div.system--items-list .item-content-image .gallery-item {
        min-width: 310px;
        width: 310px;
        margin: 0 auto;
    }

    .gallery-thumbs {
        display: none;
    }

    .item-content-element img {
        width: 72px;
        height: 72px;
        grid-area: 1 / 1 / 4 / 2;
    }

    .item-content-element .system-link-heading {
        font-size: 14px;
        line-height: 17px;
    }

    .item-content-element span {
        font-size: 12px;
        line-height: 14px;
    }

    .item-content-element {
        grid-template-columns: 72px auto;
        align-items: flex-start;
        gap: 4px;
    }

    .item-content-title .system-item-heading {
        font-size: 20px;
        line-height: 24px;
    }

    .system-section-usage .system-section-heading {
        font-size: 20px;
        margin-left: max(0px, calc((100dvw - 340px) / 2));
    }

    .system-section-trinkets {
        /* padding-left: max(0px, calc((100dvw - 340px) / 2)); */
        /* padding-right: max(0px, calc((100dvw - 340px) / 2)); */
    }

    .system-trinkets-content .item-content-title,
    .system-trinkets-content .item-content-detail,
    .system-trinkets-content .item-content-elements {
        padding-left: max(0px, calc((100dvw - 340px) / 2));
        padding-right: max(0px, calc((100dvw - 340px) / 2));
    }

    .system-trinkets-content .item-content-image {
        padding-left: max(0px, calc((100dvw - 340px) / 2));
    }

    .system-trinkets-content {
        margin-top: 24px;
    }

    div.system--items-list {
        padding-top: 0;
    }

    ul.system-trinkets-tabs {
        padding-left: max(0px, calc((100dvw - 340px) / 2));
        margin-left: calc(50% - 50dvw);
    }

    ul.system-trinkets-tabs li {
        padding: 10px 8px;
    }

    ul.system-trinkets-tabs li.active {
        padding: 10px 8px;
    }

    .system--items-slider .system-slide {
        max-width: 300px;
    }

    .system-slider-fullbleed {
        padding-left: max(0px, calc((100dvw - 340px) / 2));
    }

    .system-section-trinkets .system-slider-fullbleed {
        padding-left: 0 !important;
    }

    ul.system-trinkets-tabs {
        padding-left: 0;
        gap: 8px;
        justify-content: center;
    }

    ul.system-trinkets-tabs li a {
        font-size: 11px;
        line-height: 20px;
    }
}