/*=============================================
                Страница деталей товара
===============================================*/

.product-detail-page {
    margin-top: 100px;
}

.product-detail-container {
    display: flex;
    justify-content: flex-start;
}

/*=============================================
                Галерея изображений
===============================================*/

.product-gallery {
    position: relative;
    max-width: 500px;
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 24px;
    overflow: hidden;
    background-color: #f8f8f8;
    cursor: zoom-in !important;
    touch-action: pan-y;
}

.main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    cursor: zoom-in !important;
    pointer-events: auto;
    will-change: transform;
}

.main-image.primary-image {
    z-index: 2;
}

.main-image.transition-image {
    z-index: 3;
    pointer-events: none;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.gallery-nav:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 15px;
}

.gallery-nav.next {
    right: 15px;
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav:disabled:hover {
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
}

.gallery-nav img {
    width: 20px;
    height: 20px;
}

.thumbnails-container {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0;
}

.thumbnail {
    flex: 1;
    aspect-ratio: 1/1;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background-color: #f8f8f8;
}

.thumbnail:hover {
    border-color: #e0e0e0;
    transform: scale(1.02);
}

.thumbnail.active {
    border-color: #000000;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*=============================================
                Информация о товаре
===============================================*/

.product-info {
    margin-left: 60px;
    padding: 0 20px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.product-title {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 400;
    color: #000000;
    margin: 0;
    letter-spacing: -1px;
    line-height: 1.2;
    flex: 1;
}

.product-price {
    font-size: 26px;
    font-weight: 200;
    color: #000000;
    margin: 0;
    white-space: nowrap;
}

/*=============================================
                Кнопки действий
===============================================*/

.product-actions {
    display: flex;
    gap: 15px;
}

.action-button {
    width: 100%;
    max-width: 150px;
    height: 44px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Onest', sans-serif;
}

.action-button.buy {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #000000;
}

.action-button.buy:hover {
    background-color: #f5f5f5;
    border-color: #666666;
    transform: scale(1.02);
}

.action-button.cart {
    background-color: #000000;
    color: #ffffff;
}

.action-button.cart:hover {
    background-color: #333333;
    transform: scale(1.02);
}

/*=============================================
                Дополнительная информация
===============================================*/

.product-benefits {
    margin-top: 20px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 200;
    color: #000000;
}

.benefit-item:last-child {
    margin-bottom: 0;
}

.benefit-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/*=============================================
                Описание товара
===============================================*/

.product-description {
    margin-top: 50px;
}

.description-title {
    margin: 0;
    padding: 0;
    font-size: 18px;
    font-weight: 400;
    color: #000000;
}

.description-divider {
    margin-top: 10px;
    width: 100%;
    height: 1px;
    background-color: #A8A6A6;
}

.description-text {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 200;
    color: #666666;
    line-height: 1.6;
}

/*=============================================
                Адаптивность
===============================================*/

@media (max-width: 1024px) {
    .product-detail-container {
        gap: 30px;
    }
    
    .product-info {
        margin-left: 40px;
    }
    
    .thumbnails-container {
        gap: 10px;
    }
    
    .thumbnail {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 768px) {
    .product-detail-page {
        margin-top: 20px;
    }
    
    .product-detail-container {
        flex-direction: column;
        gap: 25px;
    }
    
    .product-gallery {
        max-width: 100%;
    }
    
    .main-image-container {
        aspect-ratio: 4/3;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-nav img {
        width: 18px;
        height: 18px;
    }
    
    .thumbnails-container {
        display: none;
    }
    
    .product-info {
        margin-left: 0;
        padding: 0;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .product-price {
        font-size: 24px;
    }
    
    .product-actions {
        gap: 12px;
    }
    
    .product-description {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .product-detail-container {
        gap: 20px;
    }
    
    .main-image-container {
        aspect-ratio: 1/1;
        border-radius: 16px;
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
    }
    
    .gallery-nav.prev {
        left: 10px;
    }
    
    .gallery-nav.next {
        right: 10px;
    }
    
    .gallery-nav img {
        width: 16px;
        height: 16px;
    }
    
    .thumbnails-container {
        display: none;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .product-price {
        font-size: 20px;
    }

    .product-actions {
        width: 100%;
    }
    
    .action-button {
        height: 40px;
        font-size: 14px;
    }
    
    .product-description {
        margin-top: 25px;
    }
    
    .description-title {
        font-size: 16px;
    }
    
    .description-text {
        font-size: 14px;
    }
}

/*=============================================
                Лайтбокс изображений
===============================================*/

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    touch-action: pan-y;
}

.lightbox-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 24px;
    will-change: transform;
}

.lightbox-image.primary-image {
    z-index: 2;
}

.lightbox-image.transition-image {
    z-index: 3;
    pointer-events: none;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.lightbox-close img {
    width: 20px;
    height: 20px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10001;
}

.lightbox-nav:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-nav img {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .lightbox-close img {
        width: 18px;
        height: 18px;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-nav img {
        width: 20px;
        height: 20px;
    }

    .lightbox-content {
        width: 95%;
        height: 85vh;
        max-height: 85vh;
    }

    .lightbox-image {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .lightbox-close img {
        width: 16px;
        height: 16px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-nav img {
        width: 18px;
        height: 18px;
    }
}