﻿
/*
   Index
*/
.card-img-top {
    height: 300px;
    object-fit: contain;
    padding: 10px;
}

/*
    Product Page
*/
body {
    background-color: #ffffff;
    font-family: 'Montserrat', sans-serif;
}


.product-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.back-button {
    font-size: 16px;
    color: #007BFF;
    border: 1px solid #008DD2;
    padding: 5px 10px;
    border-radius: 30px;
    text-decoration: none;
}

.product-title {
    font-size: 28px;
    font-weight: bold;
}


.main-image {
    max-width: 100%; /* Сохраняем, чтобы изображение не выходило за рамки родителя */
}

    .main-image img {
        width: 100%; /* Сделаем 100%, чтобы изображение заполняло колонку */
        height: 310px;
        object-fit: contain; /* или 'cover' для обрезки фото*/
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    }

.product-description {
    /* flex: 1 1 500px; */ /* Эти свойства теперь управляются Bootstrap-колонками */
    max-width: 100%; /* Сохраняем, чтобы текст не выходил за рамки родителя */
}

.description-text {
    max-height: 250px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.btn-primary {
    background-color: #008DD2;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    color: white;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    margin-top: 15px;
}

    .btn-primary:hover {
        background-color: #0070b0;
    }

.gallery-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    margin-top: 10px !important; /* Уменьшаем отступ сверху */
    width: 100%; /* Галерея будет занимать всю ширину колонки */
}

.gallery-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

    .gallery-scroll::-webkit-scrollbar {
        height: 10px;
    }

    .gallery-scroll::-webkit-scrollbar-thumb {
        background: #007BFF;
        border-radius: 3px;
    }

.thumbnail {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    cursor: pointer;
}

    .thumbnail:hover {
        transform: scale(1.05);
    }

.scroll-btn {
    position: absolute;
    top: 40%;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    border-radius: 5px;
}

.scroll-left {
    left: 0;
}

.scroll-right {
    right: 0;
}

.nav-tabs .nav-link {
    border: none;
    font-weight: 500;
    color: #007BFF;
}

    .nav-tabs .nav-link.active {
        border-bottom: 2px solid #008DD2;
        color: #000;
    }

.table td {
    vertical-align: middle;
}


@media (max-width: 992px) {
    /* --- Контейнер и общие отступы --- */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }

    .product-title {
        font-size: 22px;
        margin-top: 5px;
        text-align: left;
    }

    .back-button {
        font-size: 14px;
        padding: 4px 12px;
        border-radius: 20px;
    }

    /* --- Блок с фото и описанием --- */
    .product-details-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .main-image img {
        height: auto;
        max-height: 280px;
        border-radius: 8px;
    }

    /* --- Галерея фото --- */
    .gallery-wrapper {
        margin-top: 6px !important;
        padding-bottom: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        width: 100%;
        max-width: 100%;
        cursor: grab;
    }

        .gallery-wrapper:active {
            cursor: grabbing;
        }

    .gallery-scroll {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        justify-content: flex-start;
        align-items: center;
        min-width: 100%;
        width: max-content;
        overflow-x: auto;
    }

        .gallery-scroll::-webkit-scrollbar {
            display: none; /* скрыть полосу прокрутки */
        }

    .thumbnail {
        width: 80px;
        height: 60px;
        flex-shrink: 0;
        border-radius: 6px;
    }

    /* --- Описание --- */
    .product-description {
        margin-top: 10px;
        margin-bottom: 5px;
    }

    .description-text {
        max-height: 250px;
        overflow: hidden;
        position: relative;
        font-size: 14px;
        line-height: 1.5;
    }

        /* Тень снизу (намёк, что можно раскрыть) */
        .description-text::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 40px;
            background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
        }

    /* --- Кнопки и форма покупки --- */
    .price-action-container {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .btn-primary {
        margin-top: 5px;
        padding: 8px 16px;
        font-size: 14px;
        border-radius: 6px;
    }

    .input-group.input-group-sm {
        width: 90px;
    }

    /* --- Табуляция (вкладки) --- */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        scrollbar-width: none;
        border-bottom: 1px solid #ddd;
    }

        .nav-tabs::-webkit-scrollbar {
            display: none;
        }

        .nav-tabs .nav-item {
            flex: 0 0 auto;
        }

        .nav-tabs .nav-link {
            font-size: 14px;
            padding: 8px 10px;
            white-space: nowrap;
        }

    .tab-content {
        margin-top: 10px;
    }

    /* --- Таблицы и отзывы --- */
    .table {
        font-size: 14px;
    }

    .reviews-section h4 {
        font-size: 18px;
    }

    /* --- Модальные окна --- */
    .modal-dialog {
        margin: 10px;
    }

    .modal-content {
        border-radius: 10px;
    }
}

/* Ещё чуть компактнее для телефонов */
@media (max-width: 576px) {
    .thumbnail {
        width: 70px;
        height: 50px;
    }

    .product-title {
        font-size: 20px;
    }

    .btn-primary {
        font-size: 13px;
        padding: 7px 14px;
    }

    .price-info .fs-5 {
        font-size: 18px;
    }
}
