/* Стили для карточки товара */
.product-detail {
    margin-bottom: 40px;
}

.product-detail h1 {
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.product-wrapper {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
    gap: 30px;
}

.product-gallery {
    width: 100%;
    max-width: 100%;
}

.product-info {
    width: 100%;
}

.product-main-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    aspect-ratio: 4/3;
    position: relative;
    background-color: #fff;
}

.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    z-index: 5;
}

.product-main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: zoom-in;
}

.gallery-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    padding: 0 15px;
    z-index: 10;
}

.gallery-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    pointer-events: auto;
    backdrop-filter: blur(2px);
    font-size: 20px;
    z-index: 15;
}

.gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

.gallery-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1);
}

.product-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    justify-content: center;
}

.thumbnail {
    width: 70px;
    height: 70px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.7;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.thumbnail.active {
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.thumbnail.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: #0078d4;
    border-radius: 3px;
}

.thumbnail:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Анимация смены изображений */
.product-main-image.loading .image-container {
    background-color: rgba(240, 240, 240, 0.4);
}

.product-main-image.loading img {
    opacity: 0.6;
    transform: scale(0.98);
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .product-wrapper {
        grid-template-columns: 1fr;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .product-main-image {
        aspect-ratio: 3/2;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}