/* product_page */
.container {
    display: flex;
    flex-direction: row;
    max-width: 100%;
    padding-top: 30px;
    position: relative;
}

/* Секция карусели */
.carousel {
    flex-grow: 0;
    display: flex;
    flex-direction: column-reverse;
    justify-content: start;
    align-items: center;
    min-width: 450px;
    margin-right: 50px;
    gap: 20px;
}
.carousel > .image-wrapper {
    min-width: 450px;
}
.carousel-thumbs {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.carousel-thumbs img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
}

.carousel-thumbs img:hover {
    transform: scale(1.1);
}

.main-image {
    width: 100%;
    max-height: 70vh;
    min-height: 400px;
    height: 100%;
    border-radius: 10px;
    cursor: pointer;
}

/* Описание товара */

.product_title_line {
    background-color: var(--border_gray);
    padding: 10px;
    border-radius: 5px;
    display: flex; /* Делаем контейнер flex-контейнером */
    justify-content: space-between; /* Распределяем блоки по ширине контейнера */
    align-items: start; /* Выравниваем блоки по вертикали */
    gap: 20px; /* Расстояние между блоками */
    padding: none; /* Внутренние отступы контейнера */
    /* margin-bottom: 15px; */
}
.product-info {
    display: flex;
    flex-direction: column;
    width: max-content;
    flex-shrink: 1;
    max-width: 70%;
}

.product-title {
    font-size: 28px;
    font-weight: bold;
    color: #000;
}

.product-info > p {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.6;
}
.product-price {
    font-size: 28px !important;
    font-weight: bold;
    color: black;
    margin: 0 !important;
}
.product-info > ul {
    list-style-type: none;
    margin-bottom: 10px; /*равно p*/
    padding: 0;
    font-family: "Arial", sans-serif;
    color: black;
}

/* Стили для элементов списка */
.product-info ul li {
    padding: 5px 15px;
    margin: 5px 0;
    background-color: #f9f9f9;
    border-left: 4px solid #ccc;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.button.active svg path {
    fill: var(--primary);
    transition: 0.3s;
}
.button.active:hover svg path {
    fill: white;
    transition: 0.3s;
}

/* стрелки галереи */
.image-wrapper {
    position: relative;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 22px;
    display: flex;
    font-weight: 900;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    padding: 0;
    z-index: 2;
    padding-bottom: 5px;
}

.carousel-thumbs img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    opacity: 0.6 !important;
    transition: 0.3s;
    border: 2px solid transparent;
}

.carousel-thumbs img.active:hover {
    /* transform: scale(1.05); */
    opacity: 1 !important;
    border: 3px solid var(--primary); /* возвращаем рамку */
    box-shadow: 0 0 0 2px white; /* если было */
    z-index: 1;
}

.carousel-thumbs img.active {
    opacity: 1 !important;
    border: 3px solid var(--primary) !important;
    box-shadow: 0 0 0 2px black;
    z-index: 1;
}

.carousel-btn.prev {
    left: 10px;
}
.carousel-btn.next {
    right: 10px;
}
.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 0.5em; /* вертикальные и горизонтальные отступы между тегами */
}
.tag {
    display: inline-block; /* теперь margin-right/ margin-bottom будет работать */
    font-size: 1em;
    background-color: var(--border_gray);
    border-radius: 10px;
    padding: 5px 10px;
    margin: 0.4em 0.4em 0 0; /* верхний, правый, нижний, левый */
}
/* Общие отступы и типографика для markdown-контента */
.product-description {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Заголовки уровня 2 (##) */
.product-description h2 {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-size: 1.25rem;
    font-weight: bold;
    color: #222;
}

/* Заголовки уровня 3 (###) — если понадобятся */
.product-description h3 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
    font-size: 1.1rem;
    font-weight: bold;
    color: #222;
}

/* Обычные абзацы */
.product-description p {
    margin: 0.5em 0;
}

/* Списки пунктов (используем blockquote-подобный стиль) */
.product-description ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.product-description li {
    background: #f5f5f5;
    border-left: 4px solid #ccc;
    padding: 0.75em 1em;
    margin: 0.5em 0;
    border-radius: 2px;
}

/* Если твои «преимущества»/«недостатки» были обёрнуты в <blockquote> */
.product-description blockquote {
    background: #f5f5f5;
    border-left: 4px solid #ccc;
    padding: 0.75em 1em;
    margin: 0.5em 0;
    border-radius: 2px;
}
.description-wrapper {
    position: relative;
    max-height: 2000px; /* высота видимой области */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.read-more-btn {
    display: none;
}
@media screen and (max-width: 480px) {
    .description-wrapper {
        position: relative;
        max-height: 160px; /* высота видимой области */
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .description-wrapper.expanded {
        max-height: 2000px; /* раскрываем блок */
    }

    .read-more-btn {
        display: block;
        font-size: 16px;
        color: var(--gray_element);
        cursor: pointer;
        user-select: none;
        font-weight: 500;
    }
    .product-tags {
        display: flex;
        flex-wrap: wrap;
        font-size: 14px;
        color: #222;
        gap: 0.1em 0.1em;
        padding-bottom: 0.1em;
    }
    .container {
        padding-top: 15px;
        flex-direction: column;
        margin-right: 0px;
    }
    .product-info .gap-mini {
        display: none;
    }
    .carousel {
        width: 100%;
        flex-direction: column-reverse;
        text-align: center;
        padding-right: 0px;
        min-width: auto;
        height: fit-content;
    }
    .carousel > .image-wrapper {
        min-width: auto;
        height: fit-content;
    }
    .carousel-thumbs {
        display: flex;
        flex-direction: row;
        max-width: 100%;
        text-align: center;
        justify-content: center;
    }
    .product-info {
        max-width: 100%;
    }
    .product_title_line {
        flex-direction: row;
        justify-content: space-between;
        gap: 0px;
    }
    .product-title {
        font-size: 22px;
    }

    .product-info > p {
        font-size: 18px;
        margin-bottom: 10px;
        line-height: 1.6;
    }
    .product-price {
        min-width: 90px;
        font-size: 25px !important;
        font-weight: bold;
        color: black;
        margin: 0 !important;
    }
    .product-info > ul {
        list-style-type: none;
        margin-bottom: 10px; /*равно p*/
        padding: 0;
        font-family: "Arial", sans-serif;
        color: black;
    }
    .container {
        gap: 15px;
    }
    .product-title {
        order: 1;
    }
    .product-price {
        order: 2;
    }

    .product-description {
        order: 4;
    }
}
