/* Страница товара */
.product {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    padding: 170px 100px 60px 100px;
}

/* Галерея */
.product .gallery {
    width: 45%;
    flex-shrink: 0;
}

.product .gallery .main-image {
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(233, 236, 243, 1);
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: zoom-in;
}

.product .gallery .main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product .gallery .thumbnails {
    display: flex;
    gap: 15px;
    padding-top: 15px;
}

.product .gallery .thumbnails .thumbnail {
    width: calc((100% - 30px) / 3);
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid rgba(233, 236, 243, 1);
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.product .gallery .thumbnails .thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product .gallery .thumbnails .thumbnail.active {
    border-color: rgba(29, 43, 79, 1);
}

/* Информация о товаре */
.product .info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.product .info h2 {
    color: rgba(29, 43, 79, 1);
    font-size: 34px;
    font-weight: 700;
    font-family: "Playfair Display", serif;
    padding-bottom: 10px;
}

.product .info .sku {
    color: rgba(80, 90, 110, 1);
    font-size: 14px;
    padding-bottom: 20px;
}

.product .info .price {
    color: rgba(29, 43, 79, 1);
    font-size: 28px;
    font-weight: 700;
    padding-bottom: 25px;
}

.product .info .option {
    display: flex;
    flex-direction: column;
    padding-bottom: 25px;
}

.product .info .label {
    color: rgba(29, 43, 79, 1);
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 12px;
}

.product .info .colors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product .info .colors .color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(233, 236, 243, 1);
    transition: transform 0.2s ease;
}

.product .info .colors .color:hover {
    transform: scale(1.15);
}

.product .info .colors .color.selected {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(29, 43, 79, 1);
}

/* Количество и покупка */
.product .info .purchase {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 12px;
    column-gap: 20px;
    padding-bottom: 30px;
}

.product .info .purchase .label {
    flex-basis: 100%;
    padding-bottom: 0;
}

.product .info .purchase .quantity {
    display: flex;
    align-items: center;
    border: 1px solid rgba(233, 236, 243, 1);
    border-radius: 8px;
}

.product .info .purchase .quantity button {
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    color: rgba(80, 90, 110, 1);
    font-size: 18px;
    transition: color 0.2s ease;
}

.product .info .purchase .quantity button:hover {
    color: rgba(29, 43, 79, 1);
}

.product .info .purchase .quantity .count {
    min-width: 30px;
    text-align: center;
    color: rgba(29, 43, 79, 1);
    font-size: 16px;
    font-weight: 600;
}

.product .info .purchase .add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: rgba(244, 180, 0, 1);
    border: none;
    border-radius: 8px;
    padding: 13px 45px;
    color: rgba(29, 43, 79, 1);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.25s ease;
}

.product .info .purchase .add-to-cart img {
    width: 16px;
    height: 16px;
}

.product .info .purchase .add-to-cart:hover {
    background-color: rgba(220, 160, 0, 1);
}

/* Описание и характеристики */
.product .info .details {
    border: 1px solid rgba(233, 236, 243, 1);
    border-radius: 12px;
    padding: 25px;
}

.product .info .details h3 {
    color: rgba(29, 43, 79, 1);
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 12px;
}

.product .info .details p {
    color: rgba(80, 90, 110, 1);
    font-size: 14px;
    line-height: 1.6;
    padding-bottom: 20px;
}

.product .info .details ul {
    padding-left: 20px;
}

.product .info .details ul li {
    color: rgba(80, 90, 110, 1);
    font-size: 14px;
    line-height: 1.6;
    padding-bottom: 6px;
}

.product .info .details ul li b {
    color: rgba(29, 43, 79, 1);
    font-weight: 600;
}

/* Лайтбокс просмотра фото */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background-color: rgba(29, 43, 79, 0.85);
}

.lightbox[hidden] {
    display: none;
}

.lightbox .photo {
    max-width: 75%;
    max-height: 85%;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    object-fit: contain;
}

.lightbox .close {
    position: absolute;
    top: 25px;
    right: 35px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 42px;
    line-height: 1;
}

.lightbox .arrow {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    flex-shrink: 0;
}

.lightbox .arrow img {
    width: 22px;
    height: 22px;
}

/* Адаптация страницы товара */
@media (max-width: 1440px) {
    .product {
        padding: 170px 60px 50px 60px;
    }
}

@media (max-width: 1240px) {
    .product {
        padding: 150px 40px 40px 40px;
        gap: 30px;
    }

    .product .gallery .main-image {
        height: 420px;
    }

    .product .info h2 {
        font-size: 28px;
    }
}

@media (max-width: 1024px) {
    .product {
        flex-direction: column;
        padding: 30px;
        gap: 30px;
    }

    .product .gallery {
        width: 100%;
    }

    .product .info h2 {
        font-size: 26px;
    }

    .product .info .option {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        padding-bottom: 20px;
    }

    .product .info .option .label {
        padding-bottom: 0;
        flex-shrink: 0;
    }

    .product .info .purchase {
        justify-content: space-between;
    }

    .product .info .purchase .label {
        flex-basis: auto;
    }

    .product .info .purchase .add-to-cart {
        flex-basis: 100%;
    }
}

@media (max-width: 768px) {
    .product .gallery .main-image {
        height: 360px;
    }

    .product .gallery .thumbnails .thumbnail {
        height: 110px;
    }

    .lightbox {
        gap: 0;
    }

    .lightbox .photo {
        max-width: 86%;
        max-height: 78%;
        padding: 12px;
    }

    .lightbox .arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 42px;
        height: 42px;
    }

    .lightbox .arrow.left {
        left: 10px;
    }

    .lightbox .arrow.right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .product {
        padding: 20px 16px;
    }

    .product .gallery .main-image {
        height: 300px;
        padding: 12px;
    }

    .product .gallery .thumbnails {
        gap: 10px;
    }

    .product .gallery .thumbnails .thumbnail {
        width: calc((100% - 20px) / 3);
        height: 92px;
    }

    .product .info h2 {
        font-size: 22px;
    }

    .product .info .price {
        font-size: 24px;
    }

    .product .info .details {
        padding: 18px;
    }
}

@media (min-width: 1680px) {
    .product {
        padding-left: 12%;
        padding-right: 12%;
    }
}
