.pname {
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: rgb(100, 85, 126);
    margin: 0.05rem 0;
    font-size: 1.5rem;
    text-align: center;
    text-decoration: none;
}

.custom-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start; /* Выравниваем по верху */
    align-items: center;*/
    margin: 0;
    max-width: 31%;  /* Занимаем всю доступную ширину */
}

.image-container {
    max-width: 100%;
    margin-left: 1rem;
}

.main-image {
    display: flex;
    flex: 1;
    margin-top: 1rem;
    margin-bottom: 2rem;
    margin-left: 0;
}

.main-image img {
    height: 23rem; /* Фиксированная высота */
    width: auto;   /* Поддерживаем соотношение сторон */
}

.image-thumbnails {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-left: 39rem;
}

.thumbnail {
    width: 80px; /* Ширина миниатюры */
    height: auto;
    margin: 0 10px;
    cursor: pointer; /* Указатель для наведения */
    transition: border 0.3s;
}

.video-container {
    display: flex;
    flex: 1;
    margin-top: -6rem;
    margin-left: 1rem;
    justify-content: center;
    align-items: center; /* Выравнивание по вертикали */
}

.video-container video {
    height: 15rem; /* Высота видео устанавливается на 100% от контейнера */
    width: auto; /* Автоматическая ширина для сохранения пропорций */
}

.product_detail {
    flex: 0 0 15rem; /* Фиксированная ширина */
    margin-top: -6rem;
    margin-left: 6rem;
    margin-right: 3rem;
    padding: 1rem;
    text-align: center;
    background-color: #E8E8E8;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.sub-description {
    margin-top: 10px;
    white-space: pre-wrap;
}

.submit-btn {
    display: flex;
    justify-content: center;
    /*gap: 10px;*/
    margin-top: 10px;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
}

.submit-btn button {
    width: 100%;
    background-color: rgb(100, 85, 126);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.submit-btn button:hover {
    background-color: rgb(164, 139, 205);
}

/* Модальное окно */
.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed; /* Неподвижное окно */
    z-index: 1000; /* На переднем плане */
    left: 0;
    top: 0;
    width: 100%; /* Полная ширина */
    height: 100%; /* Полная высота */
    overflow: auto; /* Скроллинг, если нужно */
    background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* Отступ сверху и авто выравнивание по центру */
    padding: 20px;
    border: 1px solid #888;
    width: 30rem; /* Задаем фиксированную ширину 400px */
    text-align: center; /* Центрируем текст */
    border-radius: 5px; /* Закругленные углы */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Небольшая тень */
}

.modal-content p {
    margin-bottom: 15px; /* Отступ снизу */
}

.modal-content button {
    background-color: rgb(100, 85, 126);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 4rem;
    margin: 0 auto; /* Центрируем кнопку */
    display: block; /* Делаем кнопку блочной для центровки */
}

.modal-content button:hover {
    background-color: rgb(164, 139, 205);
}

.description-container {
    margin-top: 0.2rem;
    margin-left: 10rem;
    margin-right: 8rem;
    margin-bottom: 0.2rem;
    text-align: left;
    /*white-space: pre; /* Сохраняет пробелы, но не переноси строк */
}

.description-container ul {
    list-style-type: none; /* Убираем маркеры */
    text-align: justify;
    font-family: Garamond, serif;
    font-weight: 400;
    font-size: 1.2rem;
    margin-top: 3rem;
    margin-left: 5rem;
    margin-right: 5rem;
    margin-bottom: 2rem;
}

.instructions-container {
    margin-top: 2rem;
    margin-left: 15rem;
    margin-right: 13rem;
    margin-bottom: 2rem;
    text-align: justify;
}

.instructions-container ul {
    list-style-type: none; /* Убираем маркеры */
    padding: 0; /* Убираем отступы для списка */
    font-family: Garamond, serif;
    font-weight: 400;
    font-size: 1.2rem;
}

@media (max-width: 768px) {

    .pname {
        font-size: 1.2rem;
    }

    .custom-container {
        flex-direction: column; /* Для мобильных устройств */
        align-items: center;
        max-width: 100%; /* Для мобильной версии */
    }

    .image-container {
        margin: 0 auto;
    }

    .main-image {
        display: flex;
        justify-content: center; /* Центрируем главное изображение */
        margin: 1rem auto; /* Убираем отступы */
    }

    .main-image img {
        height: 17rem; /* Фиксированная высота для мобильных */
    }

    .image-thumbnails {
        justify-content: center; /* Центрируем миниатюры */
        margin: 1rem auto; /* Убираем отступы */
    }

    .thumbnail {
        width: 60px; /* Уменьшаем ширину миниатюры */
        height: auto;
        margin: 0 5px; /* Меняем отступы между миниатюрами */
    }

    .video-container {
        justify-content: center; /* Центрируем видео */
        margin-top: 1rem; /* Убираем большие отступы сверху */
        margin-left: 0;
    }

    .video-container video {
        height: 10rem; /* Высота видео для мобильных */
        width: auto; /* Автоматическая ширина для сохранения пропорций */
    }

    .product_detail {
        margin: 1rem auto; /* Центруем контейнер с деталями продукта */
        max-width: 70%; /* Задаем максимальную ширину для мобильной версии */
    }

    .sub-description {
        margin-top: 10px;
        white-space: pre-wrap;
    }

    .submit-btn button {
        margin-top: 1rem;
    }

    .description-container {
        margin: 0.2rem auto;
    }

    .description-container ul {
        font-size: 1rem;
        margin-top: 0;
        margin-left: 2rem;
        margin-right: 2rem;
        margin-bottom: 0.2rem;
    }

    .instructions-container {
        margin-left: 2rem;
        margin-right: 2rem;
    }

    .instructions-container ul {
        font-size: 1rem;
    }

}

@media (max-width: 500px) {
    .thumbnail {
        width: 50px;
    }
}
