/* static/shop/css/product-video.css */

/* Контейнер для видео */
.product-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 5;
    border-radius: 0;
}

/* Видео элемент */
.product-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    background: #ffffff;
}

/* Индикатор загрузки */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #7f8c8d;
    font-size: 12px;
    z-index: 6;
}

.video-loading .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px auto;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Анимации для плавного перехода */
.product-image-container {
    position: relative;
    overflow: hidden;
}

.product-image {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Состояния при наведении */
.product-card-main:hover .product-video-container {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.product-card-main:hover .product-image {
    transform: translateX(-100%);
}

/* Отключение на мобильных устройствах */
@media (max-width: 768px) {
    .product-video-container {
        display: none !important;
    }
    
    .product-card-main:hover .product-image {
        transform: none !important;
    }
}

/* Оптимизация производительности */
.product-video {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Состояние ошибки */
.video-error {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #e74c3c;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.video-error::before {
    content: "❌";
    font-size: 24px;
    margin-bottom: 8px;
}

/* Поддержка reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .product-video-container,
    .product-image {
        transition: none;
    }
}