/* ============================================
   PRODUCTS SHARED STYLES - Netflix Style v4
   Hover = scale up + title peek
   Click = open preview modal
   ============================================ */

/* Products Container */
.products-container {
    max-width: 1320px;
    margin: 0 auto 8px;
    padding: 0 60px;
}

.products-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    line-height: 1.2;
}

/* Carousel */
.products-carousel-wrapper {
    position: relative;
    padding: 0;
    overflow: visible;
    margin-left: -60px;
    margin-right: -60px;
}

.products-carousel {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    padding: 16px 60px 32px 60px;
    margin: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding-left: 60px;
    position: relative;
}

.products-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.75);
    border: none;
    color: white;
    width: 48px;
    height: 100px;
    cursor: pointer;
    z-index: 150;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.95);
}

.carousel-arrow-left {
    left: 60px;
    border-radius: 0 4px 4px 0;
}

.carousel-arrow-right {
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* ============================================
   PRODUCT CARD - Netflix Style v4
   Bigger cards, hover=scale+title, click=modal
   ============================================ */

.product-card {
    position: relative;
    border-radius: 6px;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                z-index 0s 0.3s,
                box-shadow 0.3s ease;
    flex: 0 0 auto;
    width: 300px;
}

.product-card:hover {
    transform: scale(1.08);
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                z-index 0s 0s,
                box-shadow 0.3s ease;
}

.product-card:hover .product-card-image-wrap {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

/* Image wrapper */
.product-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #141414;
    transition: box-shadow 0.3s ease;
}

.product-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-image-wrap img {
    transform: scale(1.06);
}

.product-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2B2B2B, #1A1A1A);
    color: rgba(255, 255, 255, 0.12);
    font-size: 42px;
}

/* Title overlay - shows on hover, gradient at bottom */
.product-card-title-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 14px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.product-card:hover .product-card-title-bar {
    opacity: 1;
}

.product-card-title-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ============================================
   NEW / NOWOSC BADGE - Netflix corner ribbon
   ============================================ */

.product-card-new-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    overflow: hidden;
    width: 90px;
    height: 90px;
    pointer-events: none;
}

.product-card-new-badge::before {
    content: 'NOWE';
    position: absolute;
    top: 16px;
    left: -22px;
    width: 110px;
    padding: 4px 0;
    background: #e50914;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.6);
}

/* ============================================
   VIDEO HOVER - Netflix Style
   ============================================ */

.product-card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

.product-card-video.playing {
    opacity: 1;
}

/* Hide video on mobile - save bandwidth */
@media (max-width: 768px) {
    .product-card-video {
        display: none !important;
    }
}

/* Legacy compat - hide old elements */
.product-card-overlay { display: none; }
.product-card-info { display: none; }
.product-card-expand { display: none; }

/* ============================================
   PREVIEW MODAL (opens on card click)
   ============================================ */

.product-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 0;
}

.product-preview-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.product-preview-modal {
    position: absolute;
    width: 480px;
    background: #181818;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.9);
    opacity: 0;
    z-index: 200;
}

.product-preview-overlay.active .product-preview-modal {
    opacity: 1;
}

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

.preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.preview-background {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    background-size: cover;
    background-position: center;
    border-radius: 8px 8px 0 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-preview-overlay.active .preview-background {
    opacity: 1;
    transition-delay: 0.15s;
}

/* ===== Video Controls Overlay ===== */

.video-controls-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.video-controls-wrap > * {
    pointer-events: auto;
}

/* Clickable overlay for play/pause (fills video area) */
.video-controls-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Center play/pause indicator */
.video-play-center {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Show center icon on hover (subtle) */
.video-controls-wrap:hover .video-play-center,
.video-controls-wrap.vc-visible .video-play-center {
    opacity: 0.7;
    transform: scale(1);
}

.video-controls-wrap:hover .video-play-center:hover {
    opacity: 1;
    transform: scale(1.08);
}

/* Flash animation on click */
.video-play-center.vc-flash {
    animation: vcFlash 0.45s ease-out;
}

@keyframes vcFlash {
    0%   { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* Bottom controls bar */
.video-controls-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-controls-wrap:hover .video-controls-bar,
.video-controls-wrap.vc-visible .video-controls-bar {
    opacity: 1;
    transform: translateY(0);
}

/* Control buttons */
.vc-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.vc-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.vc-btn:active {
    transform: scale(0.95);
}

.vc-sound-active {
    background: rgba(76, 175, 80, 0.4) !important;
}

.vc-sound-active:hover {
    background: rgba(76, 175, 80, 0.6) !important;
}

/* Time label */
.vc-time {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    font-family: monospace;
    min-width: 32px;
    text-align: center;
    flex-shrink: 0;
    user-select: none;
}

/* Progress bar */
.vc-progress {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s ease;
}

.vc-progress:hover {
    height: 6px;
}

.vc-progress-filled {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
    transition: none;
    position: relative;
}

.vc-progress:hover .vc-progress-filled {
    background: #4CAF50;
}

.vc-progress-filled::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.vc-progress:hover .vc-progress-filled::after {
    transform: translateY(-50%) scale(1);
}

/* When video is paused — keep controls always visible */
.video-controls-wrap.vc-paused .video-play-center {
    opacity: 0.85;
    transform: scale(1);
}

.video-controls-wrap.vc-paused .video-controls-bar {
    opacity: 1;
    transform: translateY(0);
}

.preview-background::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.preview-animated-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg,
        rgba(232, 182, 71, 0.06) 0%, transparent 50%,
        rgba(59, 130, 246, 0.04) 100%);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    opacity: 0.3;
    z-index: 2;
    mix-blend-mode: overlay;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.preview-background::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent 0%, #181818 100%);
    z-index: 3;
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 22px 20px;
    position: relative;
    margin-top: -36px;
    background: linear-gradient(to top, #181818 85%, transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-preview-overlay.active .preview-content {
    opacity: 1;
    transition-delay: 0.2s;
}

.preview-left { z-index: 10; position: relative; }
.preview-right { display: none; }

.preview-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-amber);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.preview-tags {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.preview-tag {
    padding: 3px 8px;
    background: rgba(43, 43, 43, 0.9);
    color: rgba(255, 255, 255, 0.75);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.preview-description {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preview-price {
    font-size: 20px;
    font-weight: 700;
    color: #46d369;
    margin-bottom: 14px;
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.btn-preview-primary {
    background: var(--white);
    color: var(--ink-900);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.btn-preview-primary:hover {
    background: rgba(255, 255, 255, 0.85);
}

.btn-preview-secondary {
    background: rgba(109, 109, 110, 0.7);
    color: var(--white);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.btn-preview-secondary:hover {
    background: rgba(109, 109, 110, 0.9);
}

.preview-image { display: none; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .product-preview-modal {
        width: calc(100vw - 32px) !important;
        left: 16px !important;
        right: 16px !important;
    }

    .preview-background { height: 200px; }
    .preview-content { padding: 12px 16px 16px; }
    .preview-title { font-size: 18px; }
    .preview-price { font-size: 17px; }

    .products-carousel-wrapper {
        margin-left: -30px;
        margin-right: -30px;
    }

    .products-carousel {
        padding: 12px 30px 28px 30px;
        scroll-padding-left: 30px;
        gap: 6px;
    }

    .carousel-arrow { width: 38px; height: 80px; }
    .carousel-arrow-left { left: 30px; }

    .product-card { width: 220px; }
}

@media (max-width: 480px) {
    .products-carousel-wrapper {
        margin-left: -16px;
        margin-right: -16px;
    }

    .products-carousel {
        padding: 10px 16px 24px 16px;
        scroll-padding-left: 16px;
        gap: 4px;
    }

    .carousel-arrow { width: 30px; height: 60px; }
    .carousel-arrow-left { left: 16px; }

    .product-card { width: 180px; }

    .product-card-new-badge { width: 76px; height: 76px; }
    .product-card-new-badge::before { top: 13px; left: -25px; font-size: 9px; }
}
