.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    margin: 10% auto;
    width: 80%;
    max-width: 600px;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 11;
}

.carousel {
    position: relative;
}

.carousel-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.carousel-slide img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    z-index: 10;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}
.product-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.product-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-right {
    flex: 2;
}

.product-main-image {
    width: 36rem;
    max-width: none;
    height: auto;
    cursor: pointer;
}

.product-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 768px) {
    .product-detail-container {
        flex-direction: column;
    }

    .product-left, .product-right {
        width: 100%;
    }
    
    .product-main-image {
        width: 100%; /* На мобильных устройствах изображение будет занимать всю доступную ширину */
        max-width: 100%;
    }
    
    .close {
        top: 5px; 
        right: 5px;
        font-size: 20px;
    }
}
.product-image-carousel {
    position: relative;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    z-index: 10;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}
.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-thumbnails {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 0;
}

.thumbnail {
    width: 50px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.thumbnail:hover {
    opacity: 1;
}

/* Адаптивный стиль для мобильных устройств */
@media (max-width: 768px) {
    .carousel-slide img {
        max-width: 100%;
        max-height: 70vh; /* Ограничиваем высоту изображения, чтобы оставить место для миниатюр */
        display: block;
        margin: auto; /* Центрируем изображение по вертикали */
    }

    .modal-content {
        padding: 10px;
    }

    .carousel-thumbnails {
        flex-wrap: nowrap; /* Убедитесь, что миниатюры не переносятся на новую строку */
    }
}