/* Product Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Product Card */
.product-card {
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}

.product-card:hover {
    transform: scale(1.05);
}

.product-card-inner {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(to bottom, rgba(23, 30, 41, 0.8), rgba(23, 30, 41, 0.95));
}

.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-image {
    transform: scale(1.1);
}

.product-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
}

.live-badge {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #ef4444 0%, #ef4444 70%, rgba(255,255,255,0.2) 70%);
}

.product-card-info {
    padding: 0.75rem 0;
}

.product-card-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-family: var(--font-body);
}

.product-card-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Product Detail Modal */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.product-modal.active {
    display: flex;
}

.product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.product-modal-content {
    position: relative;
    width: 100%;
    height: 100vh;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(23, 30, 41, 0.98);
    box-shadow: none;
}

.product-modal-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.2;
    z-index: 1;
}

.product-modal-background::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to bottom, transparent 0%, rgba(23, 30, 41, 0.9) 50%, rgba(23, 30, 41, 1) 100%);
}

.product-modal-close {
    position: fixed;
    top: 6rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #ef4444;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 99999;
    color: #ef4444;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.product-modal-close svg {
    width: 32px;
    height: 32px;
    stroke-width: 3;
}

.product-modal-close:hover {
    background: #ef4444;
    border-color: #ffffff;
    color: white;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.6);
}

@media (min-width: 768px) {
    .product-modal-close {
        width: 70px;
        height: 70px;
    }
    
    .product-modal-close svg {
        width: 36px;
        height: 36px;
    }
}

.product-modal-info {
    position: relative;
    z-index: 2;
    padding: 4rem 3rem 3rem;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .product-modal-info {
        padding: 6rem 5rem 5rem;
    }
}

@media (min-width: 1024px) {
    .product-modal-info {
        padding: 8rem 8rem 6rem;
    }
}

.product-modal-header {
    margin-bottom: 2rem;
}

.product-modal-header h2 {
    font-size: 2.5rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .product-modal-header h2 {
        font-size: 3.5rem;
    }
}

@media (min-width: 1024px) {
    .product-modal-header h2 {
        font-size: 4.5rem;
    }
}

.product-modal-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.product-rating,
.product-year {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.product-badge {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-play {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    color: #171e29;
    border: none;
    padding: 1.25rem 2.5rem;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-play:hover {
    background: white;
    transform: scale(1.02);
}

@media (min-width: 768px) {
    .btn-play {
        padding: 1.5rem 3rem;
        font-size: 1.25rem;
    }
}

.product-modal-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    max-width: 600px;
}

.btn-secondary {
    flex: 1;
    background: linear-gradient(135deg, #ef4444 0%, #ec4899 50%, #f43f5e 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4),
                0 8px 25px rgba(236, 72, 153, 0.3),
                inset 0 -2px 5px rgba(0, 0, 0, 0.2),
                inset 0 2px 5px rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5),
                0 10px 35px rgba(236, 72, 153, 0.4),
                inset 0 -2px 5px rgba(0, 0, 0, 0.2),
                inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4),
                0 4px 15px rgba(236, 72, 153, 0.3),
                inset 0 2px 5px rgba(0, 0, 0, 0.3),
                inset 0 -1px 3px rgba(255, 255, 255, 0.2);
}

.product-storyline {
    margin-top: 3rem;
    max-width: 900px;
}

.product-storyline p {
    font-size: 1.125rem;
    line-height: 1.8;
}

@media (min-width: 768px) {
    .product-storyline p {
        font-size: 1.25rem;
    }
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.video-modal.active {
    display: flex;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
}

.video-modal-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    z-index: 10001;
}

.video-modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10002;
}

.video-modal-close:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

#productVideo {
    width: 100%;
    max-height: 70vh;
    border-radius: 0.75rem;
    background: black;
}

/* Scrollbar Styling */
.product-modal-info::-webkit-scrollbar {
    width: 8px;
}

.product-modal-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.product-modal-info::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.product-modal-info::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-card-title {
        font-size: 0.875rem;
    }
    
    .product-card-subtitle {
        font-size: 0.75rem;
    }
    
    .product-modal {
        padding: 0;
    }
    
    .product-modal-info {
        padding: 3rem 2rem 2rem;
    }
    
    .product-modal-header h2 {
        font-size: 2rem;
    }
    
    .btn-play {
        padding: 1rem 2rem;
        font-size: 0.875rem;
    }
    
    .product-storyline p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}
