/* Видео-карточки товаров */

.product-card-video {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    height: 100%; /* Занимает всю высоту контейнера */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-video:hover {
    transform: scale(1.02);
}

.product-card-video img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет весь контейнер */
    display: block;
    transition: opacity 0.3s ease;
}

.product-card-video .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 2;
}

.product-card-video .play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 4px;
}

.product-card-video:hover .play-icon {
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
}

/* Скрываем иконку play для карточек без видео */
.product-card-video:not([data-video-preview]):not([data-video-full]) .play-icon,
.product-card-video[data-video-preview=""]:not([data-video-full]) .play-icon,
.product-card-video:not([data-video-preview]):not([data-video-full=""]):not([data-video-full]) .play-icon {
    display: none;
}

.product-card-video .video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-video .video-preview.active {
    opacity: 1;
}

.product-card-video .video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

/* Полноэкранная галерея */
.product-gallery-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-gallery-fullscreen.active {
    display: flex;
    opacity: 1;
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-slide img,
.gallery-slide video {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.gallery-slide video {
    width: 100%;
    height: 100%;
    border: none;
}

/* Заглушка для галереи */
.gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    text-align: center;
}

.gallery-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.gallery-placeholder span {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    display: block;
}

.gallery-placeholder p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.7;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

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

.gallery-nav:disabled {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

.gallery-nav:disabled::before {
    opacity: 0.5;
}

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

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

.gallery-nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.gallery-nav.prev::before {
    border-width: 8px 12px 8px 0;
    border-color: transparent #fff transparent transparent;
    margin-left: -2px;
}

.gallery-nav.next::before {
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent #fff;
    margin-left: 2px;
}

.gallery-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    font-size: 20px;
    line-height: 1;
}

.gallery-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.gallery-details-btn {
    position: absolute;
    bottom: 20px;    
    background:var(--accent-color);
    color: #000;
    border: none;
    padding: 14px 58px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.gallery-details-btn:hover {
    background: #555;
    color: white;
    text-decoration: none;
}

.gallery-counter {
    position: absolute;
    color: #333;
    z-index: 10;
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .product-card-video .play-icon {
        width: 50px;
        height: 50px;
    }
    
    .product-card-video .play-icon::before {
        border-width: 10px 0 10px 16px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-nav.prev {
        left: 10px;
    }
    
    .gallery-nav.next {
        right: 10px;
    }
    
    .gallery-close {
        top: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .gallery-details-btn {
        bottom: calc(100vh / 6);
       
      }
    
    .gallery-counter {
        top: 30px;
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.gallery-slide.active {
    animation: fadeIn 0.5s ease;
}

/* Индикатор загрузки */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
} 