#portfolio.content {
    flex-grow: 1; /* РАСТЯГИВАЕТ блок, выталкивая футер вниз */
    display: flex; /* Чтобы aside и основной контент внутри секции стояли в ряд */
    flex-wrap: nowrap;
    flex-direction: row; /* Сайдбар слева, контент справа */
    justify-content: space-between;
    align-items: flex-start;
    padding: 8rem 2rem 2rem 2rem;
    background-color: #bdd4c625;
    hyphens: auto;
    gap: 1rem;
}

#portfolio .left-sidebar h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: aliceblue;
    background-color: rgb(36, 128, 76);
    border-radius: 10px;
}

#portfolio .filter-group {
    margin-bottom: 1rem;
    display: block;
}

.filter-content label {
    display: flex;
    align-items: center;
    gap: 10px; /* Отступ между квадратиком чекбокса и текстом */
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 0;
}

.filter-content input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

aside.left-sidebar {
    width: 25%;
    background-color: white;
    text-align: left;
    padding: 1rem;
    border-radius: 20px;
}

main.right-sidebar {
    width: 75%;
    background-color: white;
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 4rem;
}

main.right-sidebar h3 {
    font-weight: 400;
    color: #333;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1;
}

main.right-sidebar a {
    text-decoration: none;
}

main.right-sidebar .slider-viewport {
    display: grid;
    grid-template-rows: repeat(2, minmax(13rem, 1fr));
    /* Заставляем карточки выстраиваться в колонки ВПРАВО, а не вниз */
    grid-auto-flow: column;
    /* 3. Задаем ширину каждой колонки (чтобы они не сжимались) */
    grid-auto-columns: minmax(13rem, 1fr);
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2rem;
}

/* Настраиваем высоту всей полосы прокрутки */
main.right-sidebar .slider-viewport::-webkit-scrollbar {
    height: 0.5rem; /* Общая высота области скроллбара */
}

/* Настраиваем "дорожку", по которой едет ползунок */
main.right-sidebar .slider-viewport::-webkit-scrollbar-track {
    background-color: rgb(36, 128, 76);
    border-radius: 3px;
    margin: 0 1rem;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

/* Настраиваем сам ползунок */
main.right-sidebar .slider-viewport::-webkit-scrollbar-thumb {
    background: white; /* Цвет ползунка */
    border-radius: 10px;
    border: 1px solid rgb(36, 128, 76);
    background-clip: padding-box;
}

@media (max-width: 1024px) {
    main.right-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    main.right-sidebar {
        grid-template-columns: 1fr;
    }
}

main.right-sidebar .slider-viewport .product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 214px; /* Жестко задаем ширину */
    /* Либо через min-width / max-width, чтобы они были идентичны */
    min-width: 214px;
    max-width: 214px;
}

#portfolio .right-sidebar .slider-viewport .product-card img {
    margin-top: 0.3rem;
    border: 1px solid #bdd4c65a;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#portfolio .right-sidebar .product-card img:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: #ddd;
}

#portfolio .right-sidebar .product-card p {
    margin: 0 0; 
    font-size: 1rem;
    text-align: center;
    line-height: 1.2;
    color: black;
}

/* Здесь начинаются стили для pop-up */
.pop-up-window::-webkit-scrollbar {
    width: 0.5rem;
    border-radius: 3px;
}

.pop-up-window::-webkit-scrollbar-track {
    background: white;
    border-radius: 10px;
}

.pop-up-window::-webkit-scrollbar-thumb {
    background: rgb(36, 128, 76);
    border-radius: 10px;
    border: 1px solid rgb(36, 128, 76);
    background-clip: padding-box;
}

.pop-up-window::-webkit-scrollbar-thumb:hover {
    background: #d4f598;
}
/* 1. Основной фон затемнения */
.pop-up-overlay {
    display: none; /* Переключается на flex через JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px); /* Эффект матового стекла */
    z-index: 10000; /* Выше шапки сайта */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* 2. Контейнер окна */
.pop-up-window {
    max-width: 80vw;   /* Окно занимает не более 90% ширины экрана */
    max-height: 90vh;  /* Окно занимает не более 90% высоты экрана */
    background-color: #ffffff;
    border-radius: 24px;
    position: relative;
    padding: 40px;
    position: fixed; /* Окно фиксируется относительно экрана */
    inset: 0;       /* Растягивает область позиционирования на весь экран */
    margin: auto;   /* Центрирует блок по горизонтали и вертикали */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Прокрутка внутри окна, если контент длинный */
    animation: popUpScale 0.3s ease-out;
}

@keyframes popUpScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* 3. Кнопка закрытия (крестик) */
.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 35px;
    font-weight: 300;
    color: #333;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.close-btn:hover {
    color: #24804c; /* Ваш фирменный зеленый */
    transform: rotate(90deg);
}

/* 4. Сетка (Картинка | Инфо) */
.pop-up-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr; /* Делит окно */
    gap: 20px;
}

/* 5. Изображение */
.pop-up-image img {
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 12px;
}

/* 6. Текстовый блок */
.pop-up-info h2 {
    margin-top: 0;
    font-size: 1.8rem;
    color: #1a1a1a;
    line-height: 1.2;
}

#modal-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a4a4a;
    margin: 20px 0;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #24804c;
    margin-bottom: 25px;
}

/* 7. Форма заказа внутри попапа */
#orderForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#orderForm input {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

#orderForm input:focus {
    border-color: #24804c;
}

#orderForm .privacy-policy {
    display: flex;          /* Включаем flexbox */
    justify-content: center; /* Центрируем содержимое по горизонтали */
    align-items: center;     /* Центрируем чекбокс и текст по вертикали друг относительно друга */
    gap: 10px;              /* Расстояние между галочкой и текстом */
    text-align: center;      /* На всякий случай для многострочного текста */
}

/* Чтобы чекбокс не сжимался, если текст длинный */
#orderForm .privacy-policy input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

/* Для удобства нажатия */
#orderForm .privacy-policy label {
    cursor: pointer;
    user-select: none; /* Чтобы текст не выделялся синим при случайном двойном клике */
}

.order-button {
    background-color: #24804c;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.order-button:hover {
    background-color: #1e6b40;
    transform: translateY(-2px);
}

#statusMessage {
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.order-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
}

/* Начало блока карусели для поп-апа */
/* Контейнер для центровки */
.carousel-container {
    width: 100%;
    text-align: center;
}

/* Эта обертка станет ровно по размеру картинки */
.carousel-viewport {
    position: relative;
    display: inline-block; /* Схлопывает блок до ширины картинки */
    vertical-align: top;
    line-height: 0;        /* Убирает лишний отступ под фото */
    border-radius: 12px;
    overflow: hidden;      /* Чтобы кнопки обрезались по углам фото */
}

.carousel-slides img {
    display: none;
    min-width: 100%;
    max-width: 100%;
    min-height: 75vh;
    max-height: 75vh; 
    object-fit: contain;
}

.carousel-slides img.active {
    display: block;
    border-radius: 12px;
}

/* Кнопки теперь будут РОВНО по высоте .carousel-viewport (то есть фото) */
.carousel-prev, .carousel-next {
    position: absolute;
    top: 0;
    height: 100%;          /* 100% высоты картинки! */
    width: 7%;            /* Ширина зоны клика */
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    transition: 0.3s;
    text-shadow: 0 0 8px rgba(0,0,0,0.5);
    outline: none;
    border-radius: 12px;
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-prev:hover, .carousel-next:hover {
    background: rgba(36, 128, 76, 0.3); /* Ваш зеленый */
}

/* Точки будут снизу, так как они вне вьюпорта */
.carousel-dots {
    margin-top: 15px;
    line-height: normal; /* Сбрасываем line-height: 0 */
}

.dot {
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}

.dot.active { background-color: rgb(36, 128, 76); }

@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

/* Оверлей для полноэкранного фото */
.full-size-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Темный фон */
    z-index: 2000; /* Выше основного поп-апа */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

/* Само изображение */
.full-size-overlay img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

/* Кнопка закрытия */
.full-size-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Указатель лупы при наведении на картинку в обычном поп-апе */
.carousel-slides img {
    cursor: zoom-in;
}

