/* Import font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* Base Styles - Sử dụng chung các biến màu với các trang khác */
:root {
    --color-black: #000000;
    --color-zinc-900: #18181b;
    --color-zinc-800: #27272a;
    --color-zinc-700: #3f3f46;
    --color-white: #ffffff;
    --color-gray-100: #f3f4f6;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-blue-400: #60a5fa;
    --color-blue-600: #2563eb;
    --border-dark: #3f3f46;
    --border-light: #52525b;
    --header-height: 80px;
}

/* Custom wrapper for WordPress */
.custom-products-wrapper {
    font-family: 'Montserrat', sans-serif !important;
    background-color: var(--color-black) !important;
    color: var(--color-gray-100) !important;
    line-height: 1.5;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

.custom-products-wrapper * {
    box-sizing: border-box;
}

.custom-products-wrapper .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Override WordPress default styles */
.custom-products-wrapper h1, 
.custom-products-wrapper h2, 
.custom-products-wrapper h3, 
.custom-products-wrapper h4, 
.custom-products-wrapper h5, 
.custom-products-wrapper h6 {
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    font-family: 'Montserrat', sans-serif !important;
}

.custom-products-wrapper a {
    text-decoration: none !important;
    color: inherit !important;
}

.custom-products-wrapper button {
    cursor: pointer;
    font-family: inherit;
}

.custom-products-wrapper ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-products-wrapper p {
    margin: 0 !important;
    font-family: 'Montserrat', sans-serif !important;
}

/* Product Header Section */
.custom-products-wrapper .product-header {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--color-black);
    z-index: 10;
}

.custom-products-wrapper .product-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    z-index: 1;
    filter: brightness(0.4);
    will-change: transform;
}

.custom-products-wrapper .product-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 100%);
    backdrop-filter: blur(1px);
    z-index: 2;
}

.custom-products-wrapper .product-header-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 20px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpHero 1.2s ease-out 0.5s forwards;
}

.custom-products-wrapper .product-header h1 {
    font-size: 3.5rem !important;
    margin-bottom: 1rem !important;
    color: var(--color-white) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.custom-products-wrapper .product-header p {
    font-size: 1.25rem !important;
    margin-bottom: 2rem !important;
    color: var(--color-gray-300) !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Product Sections */
.custom-products-wrapper .product-section {
    position: relative;
    padding: 100px 0;
    /* overflow: hidden; */
    background-color: var(--color-zinc-900);
}

.custom-products-wrapper .product-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgb(0 0 0 / 0%) 0%, rgb(24 24 27 / 0%) 100%);
    backdrop-filter: blur(0px);
    z-index: 2;
}

.custom-products-wrapper .product-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    z-index: 1;
    filter: brightness(0.2) blur(0.5px);
    transform: scale(1.05);
    will-change: transform;
}

.custom-products-wrapper .product-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.custom-products-wrapper .product-flex {
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    z-index: 3;
}

@media (min-width: 992px) {
    .custom-products-wrapper .product-flex {
        flex-direction: row;
        align-items: center;
    }

    .custom-products-wrapper .product-info {
        flex: 1;
        text-align: left;
    }

    .custom-products-wrapper .product-showcase {
        flex: 1;
    }

    .custom-products-wrapper .product-flex.reverse {
        flex-direction: row-reverse;
    }

    .custom-products-wrapper .product-flex.reverse .product-info {
        text-align: right;
    }
}

.custom-products-wrapper .product-title {
    font-size: 2.5rem !important;
    margin-bottom: 1rem !important;
    color: var(--color-white) !important;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
}

.custom-products-wrapper .product-subtitle {
    font-size: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    font-weight: 500 !important;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
}

.custom-products-wrapper .product-description {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    margin-bottom: 2rem !important;
    color: var(--color-white) !important;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
}

/* Album Showcase */
.custom-products-wrapper .album-showcase {
    position: relative;
    height: 400px;
    perspective: 1200px;
    margin: 0 auto;
    max-width: 500px;
}

.custom-products-wrapper .album-card {
    position: absolute;
    width: 85%;
    height: 85%;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(50px);
}

.custom-products-wrapper .album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.custom-products-wrapper .album-card:nth-child(1) {
    top: 10%;
    left: 10%;
    z-index: 3;
    transform: translateY(0) rotateY(0deg) scale(1);
}

.custom-products-wrapper .album-card:nth-child(2) {
    top: 15%;
    left: 5%;
    z-index: 2;
    transform: translateY(0) rotateY(-10deg) scale(0.95);
}

.custom-products-wrapper .album-card:nth-child(3) {
    top: 20%;
    left: 15%;
    z-index: 1;
    transform: translateY(0) rotateY(-20deg) scale(0.9);
}

.custom-products-wrapper .album-showcase:hover .album-card:nth-child(1) {
    transform: translateX(-30px) rotateY(15deg) scale(1.05);
}

.custom-products-wrapper .album-showcase:hover .album-card:nth-child(2) {
    transform: translateX(0) rotateY(0deg) scale(1);
}

.custom-products-wrapper .album-showcase:hover .album-card:nth-child(3) {
    transform: translateX(30px) rotateY(15deg) scale(1.05);
}

/* Product Gallery */
.custom-products-wrapper .product-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 40px;
    position: relative;
    z-index: 3;
}

@media (min-width: 768px) {
    .custom-products-wrapper .product-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

.custom-products-wrapper .product-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.custom-products-wrapper .product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.custom-products-wrapper .product-item:hover img {
    transform: scale(1.1);
}

.custom-products-wrapper .product-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-products-wrapper .product-item:hover::after {
    opacity: 1;
}

/* Product Subtitle Colors */
.custom-products-wrapper .classic .product-subtitle {
    color: #fbbf24 !important;
}

.custom-products-wrapper .prime .product-subtitle {
    color: #60a5fa !important;
}

.custom-products-wrapper .modluxe .product-subtitle {
    color: #a78bfa !important;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUpHero {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-products-wrapper .fade-up {
    opacity: 0;
    transform: translateY(30px);
}

.custom-products-wrapper .fade-up.active {
    animation: fadeUp 0.8s ease forwards;
}

.custom-products-wrapper .delay-100 {
    animation-delay: 0.1s;
}

.custom-products-wrapper .delay-200 {
    animation-delay: 0.2s;
}

.custom-products-wrapper .delay-300 {
    animation-delay: 0.3s;
}

.custom-products-wrapper .delay-400 {
    animation-delay: 0.4s;
}

.custom-products-wrapper .delay-500 {
    animation-delay: 0.5s;
}

/* Glass Button */
.custom-products-wrapper .btn-glass {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50px;
    color: var(--color-white) !important;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-decoration: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.custom-products-wrapper .btn-glass:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
    color: var(--color-white) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .custom-products-wrapper .product-header {
        height: 100vh;
        min-height: 500px;
    }

    .custom-products-wrapper .product-header-bg {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        filter: brightness(0.3);
    }

    .custom-products-wrapper .product-bg {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        filter: brightness(0.15) blur(0.5px);
        transform: scale(1.02);
    }

    .custom-products-wrapper .product-header h1 {
        font-size: 2.5rem !important;
    }

    .custom-products-wrapper .product-header p {
        font-size: 1.1rem !important;
    }

    .custom-products-wrapper .product-title {
        font-size: 2rem !important;
    }

    .custom-products-wrapper .product-subtitle {
        font-size: 1.25rem !important;
    }

    .custom-products-wrapper .product-description {
        font-size: 1rem !important;
    }

    .custom-products-wrapper .album-showcase {
        height: 300px;
    }

    .custom-products-wrapper .album-card {
        position: relative;
        width: 100%;
        height: 200px;
        margin-bottom: 20px;
        transform: none !important;
    }

    .custom-products-wrapper .album-card:nth-child(1) {
        left: 0 !important;
        top: 0 !important;
    }

    .custom-products-wrapper .album-card:nth-child(2),
    .custom-products-wrapper .album-card:nth-child(3) {
        display: none;
    }

    .custom-products-wrapper .product-flex {
        text-align: center !important;
    }

    .custom-products-wrapper .product-flex.reverse .product-info {
        text-align: center !important;
    }

    .custom-products-wrapper .product-section {
        padding: 60px 0;
    }

    .custom-products-wrapper .container {
        padding: 0 1rem;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .custom-products-wrapper .product-header h1 {
        font-size: 3rem !important;
    }

    .custom-products-wrapper .product-title {
        font-size: 2.2rem !important;
    }

    .custom-products-wrapper .album-showcase {
        max-width: 400px;
        height: 350px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-products-wrapper .product-header-bg,
    .custom-products-wrapper .product-bg {
        background-size: cover !important;
    }
}

/* MOBILE OPTIMIZATIONS - Products Page - Đồng bộ với Home */
@media (max-width: 768px) {
    /* Typography - đồng bộ với home và about */
    .custom-products-wrapper .product-header h1 {
        font-size: 28px !important; /* Đồng bộ với home */
        line-height: 1.1 !important;
        margin-bottom: 16px !important;
    }
    
    .custom-products-wrapper .product-header p {
        font-size: 16px !important; /* Đồng bộ với home */
        margin-bottom: 24px !important;
        line-height: 1.5 !important;
    }
    
    .custom-products-wrapper .product-title {
        font-size: 24px !important; /* Đồng bộ với home section-title */
        margin-bottom: 16px !important;
        line-height: 1.2 !important;
    }
    
    .custom-products-wrapper .product-subtitle {
        font-size: 16px !important; /* Đồng bộ với home */
        margin-bottom: 16px !important;
        font-weight: 500 !important;
    }
    
    .custom-products-wrapper .product-description {
        font-size: 14px !important; /* Đồng bộ với home và about */
        line-height: 1.5 !important;
        margin-bottom: 24px !important;
        text-align: left !important; /* Better mobile reading */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Spacing optimizations - đồng bộ với home */
    .custom-products-wrapper .product-section {
        padding: 40px 0; /* Đồng bộ với home */
    }
    
    .custom-products-wrapper .container {
        padding: 0 16px; /* Đồng bộ với home */
    }
    
    /* Header mobile optimizations */
    .custom-products-wrapper .product-header {
        min-height: 70vh; /* Giảm từ 100vh như home */
        height: 70vh;
    }
    
    .custom-products-wrapper .product-header-content {
        padding: 0 16px; /* Consistent padding */
    }
    
    /* Album showcase mobile - compact layout */
    .custom-products-wrapper .album-showcase {
        height: 250px; /* Giảm từ 300px */
        margin-bottom: 20px;
    }
    
    .custom-products-wrapper .album-card {
        height: 180px; /* Giảm từ 200px */
        margin-bottom: 16px;
    }
    
    /* Product gallery mobile - slide/carousel layout */
    .custom-products-wrapper .product-gallery {
        display: flex; /* Chuyển từ grid sang flex */
        overflow-x: auto; /* Enable horizontal scroll */
        gap: 16px;
        margin-top: 24px;
        margin-bottom: 24px;
        padding: 0 16px 20px 16px; /* Add padding và space cho scrollbar */
        scroll-behavior: smooth; /* Smooth scrolling */
        scrollbar-width: none; /* Hide scrollbar Firefox */
        -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
        scroll-snap-type: x mandatory; /* Snap scrolling */
    }
    
    /* Hide scrollbar cho Webkit browsers */
    .custom-products-wrapper .product-gallery::-webkit-scrollbar {
        display: none;
    }
    
    .custom-products-wrapper .product-item {
        flex: 0 0 280px; /* Fixed width, không shrink */
        aspect-ratio: 4/3; /* Landscape aspect ratio */
        scroll-snap-align: start; /* Snap alignment */
        border-radius: 12px;
        overflow: hidden;
        position: relative;
    }
    
    /* Thêm shadow và hover effect cho mobile slide */
    .custom-products-wrapper .product-item {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .custom-products-wrapper .product-item:active {
        transform: scale(0.98); /* Touch feedback */
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
    
    /* Đảm bảo ảnh cuối có đủ space */
    .custom-products-wrapper .product-item:last-child {
        margin-right: 16px;
    }
    
    /* Product flex mobile optimization */
    .custom-products-wrapper .product-flex {
        gap: 24px; /* Smaller gap */
        text-align: center !important;
    }
    
    .custom-products-wrapper .product-flex.reverse .product-info {
        text-align: center !important; /* Override text alignment */
    }
    
    /* Button optimizations */
    .custom-products-wrapper .btn-glass {
        padding: 12px 24px; /* Smaller padding */
        font-size: 14px !important; /* Smaller font */
        min-height: 44px; /* Touch-friendly */
        width: 100%; /* Full width on mobile */
        justify-content: center;
        margin-top: 16px;
    }
    
    /* Background optimizations for mobile performance */
    .custom-products-wrapper .product-header-bg,
    .custom-products-wrapper .product-bg {
        background-attachment: scroll !important; /* Better mobile performance */
        background-size: cover !important;
        background-position: center !important;
        filter: brightness(0.3); /* Slightly brighter for mobile */
    }
    
    /* Content positioning */
    .custom-products-wrapper .product-content {
        text-align: center;
        padding: 0 16px;
    }
    
    .custom-products-wrapper .product-info {
        padding: 0 16px;
    }
    
    /* Animation optimizations for mobile */
    .custom-products-wrapper .fade-up {
        animation: none; /* Disable complex animations on mobile */
        opacity: 1 !important;
        transform: none !important;
    }
    
    .custom-products-wrapper .product-header-content,
    .custom-products-wrapper .product-title,
    .custom-products-wrapper .product-subtitle,
    .custom-products-wrapper .product-description,
    .custom-products-wrapper .album-card,
    .custom-products-wrapper .product-item {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    
    /* Mobile-specific utility classes */
    .custom-products-wrapper .mobile-hidden {
        display: none !important;
    }
    
    .custom-products-wrapper .mobile-visible {
        display: block !important;
    }
    
    .custom-products-wrapper .mobile-text-center {
        text-align: center !important;
    }
    
    .custom-products-wrapper .mobile-full-width {
        width: 100% !important;
    }
}

/* EXTRA SMALL SCREENS OPTIMIZATION */
@media (max-width: 480px) {
    .custom-products-wrapper .product-section {
        padding: 32px 0; /* Even more compact */
    }
    
    .custom-products-wrapper .container {
        padding: 0 12px;
    }
    
    .custom-products-wrapper .product-header h1 {
        font-size: 24px !important; /* Smaller for very small screens */
    }
    
    .custom-products-wrapper .product-title {
        font-size: 20px !important;
    }
    
    .custom-products-wrapper .product-subtitle {
        font-size: 14px !important;
    }
    
    .custom-products-wrapper .product-description {
        font-size: 13px !important;
        margin-bottom: 20px !important;
    }
    
    .custom-products-wrapper .product-header {
        min-height: 60vh;
        height: 60vh;
    }
    
    .custom-products-wrapper .product-header-content {
        padding: 0 12px;
    }
    
    .custom-products-wrapper .album-showcase {
        height: 200px;
    }
    
    .custom-products-wrapper .album-card {
        height: 150px;
        margin-bottom: 12px;
    }
    
    .custom-products-wrapper .product-gallery {
        /* Giữ slide layout nhưng điều chỉnh cho màn hình nhỏ hơn */
        gap: 12px;
        margin-top: 20px;
        margin-bottom: 20px;
        padding: 0 12px 16px 12px; /* Smaller padding cho extra small screens */
    }
    
    .custom-products-wrapper .product-item {
        flex: 0 0 240px; /* Smaller width cho extra small screens */
        aspect-ratio: 4/3; /* Giữ nguyên aspect ratio */
    }
    
    .custom-products-wrapper .btn-glass {
        padding: 10px 20px;
        font-size: 13px !important;
    }
    
    .custom-products-wrapper .product-flex {
        gap: 20px;
    }
    
    .custom-products-wrapper .product-content,
    .custom-products-wrapper .product-info {
        padding: 0 12px;
    }
}

/* MOBILE PERFORMANCE OPTIMIZATIONS */
@media (max-width: 768px) {
    /* Reduced motion for better performance */
    @media (prefers-reduced-motion: reduce) {
        .custom-products-wrapper * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Optimize images for mobile */
    .custom-products-wrapper img {
        max-width: 100%;
        height: auto;
        image-rendering: -webkit-optimize-contrast;
    }
    
    /* Better text rendering */
    .custom-products-wrapper {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Mobile typography scale */
    .custom-products-wrapper h1 { font-size: 24px !important; }
    .custom-products-wrapper h2 { font-size: 20px !important; }
    .custom-products-wrapper h3 { font-size: 18px !important; }
    .custom-products-wrapper h4 { font-size: 16px !important; }
    .custom-products-wrapper h5 { font-size: 14px !important; }
    .custom-products-wrapper h6 { font-size: 12px !important; }
    
    /* Touch-friendly elements */
    .custom-products-wrapper .btn-glass,
    .custom-products-wrapper .product-item {
        min-height: 44px;
        min-width: 44px;
    }
} 