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

:root {
    --color-brand: #ec4899;
    --color-brand-hover: #db2777;
    --color-bg: #fdf2f8;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    user-select: none;
    -webkit-user-select: none;
    background-color: var(--color-bg);
    color: #1f2937;
    overflow-x: hidden;
    line-height: 1.6; /* Menambah jarak antar baris teks agar tidak mepet */
}

img, video {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #fff; }
::-webkit-scrollbar-thumb { background: var(--color-brand); border-radius: 5px; border: 2px solid #fff; }
::-webkit-scrollbar-thumb:hover { background: var(--color-brand-hover); }

/* ================= COMPONENTS ================= */

/* 1. Toast Notification */
#toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 400px;
}
.toast {
    background: white; padding: 16px 20px; border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    display: flex; align-items: center; gap: 12px;
    transform: translateY(-50px); opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid var(--color-brand);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* 2. Infinite Marquee (Testimoni Berjalan) */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 20px 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: inline-flex;
    gap: 24px;
    animation: scroll 35s linear infinite;
}

.marquee-item {
    width: 300px;
    white-space: normal; /* Agar teks testimoni turun ke bawah */
    flex-shrink: 0;
}

/* Pause saat di-hover agar user bisa baca */
.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Geser setengah (karena konten diduplikasi) */
}

/* 3. FAQ Smooth Animation */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}
.faq-content.open {
    max-height: 300px; /* Estimasi tinggi maksimal konten */
    opacity: 1;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in;
}
.faq-icon { transition: transform 0.3s ease; }
.faq-btn[aria-expanded="true"] .faq-icon { transform: rotate(180deg); }

/* 4. Music Visualizer (Mobile Menu) */
.music-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
}
.music-bar {
    width: 4px;
    background-color: var(--color-brand);
    border-radius: 2px;
    animation: bounce 0.8s infinite ease-in-out;
}
.music-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.music-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.music-bar:nth-child(3) { height: 70%; animation-delay: 0.2s; }
.music-bar:nth-child(4) { height: 50%; animation-delay: 0.4s; }

.paused .music-bar {
    animation-play-state: paused;
    height: 4px !important;
    transition: height 0.3s ease;
}

@keyframes bounce {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

/* 5. Mobile Menu Backdrop */
#mobile-menu-overlay {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 6. Payment Modal Animation */
@keyframes slide-up { from { transform: translate(-50%, -40%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
.animate-slide-up { animation: slide-up 0.3s ease-out forwards; }

/* 7. Utilities */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; background: transparent; }

/* 8. Modern Smooth Collapse Animation */
.smooth-collapse {
    transition-property: max-height, opacity, transform;
    transition-duration: 0.7s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); /* Easing modern */
}

.collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
    overflow: hidden;
    pointer-events: none;
    margin-top: 0 !important; /* Hilangkan margin saat tertutup */
}

.expanded {
    max-height: 1000px; /* Nilai cukup besar untuk menampung konten */
    opacity: 1;
    transform: translateY(0);
    margin-top: 1rem; /* Gap antar grid (gap-4 = 1rem) */
}

.product-slider {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    border-radius: 1rem;
}
.product-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.product-slide.active {
    opacity: 1;
    z-index: 10;
}
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(255, 255, 255, 0.8);
    color: #1f2937;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    opacity: 0; /* Hidden by default */
}
.product-slider:hover .slider-nav { opacity: 1; }
.slider-nav:hover { background: #ec4899; color: white; }
.slider-prev { left: 10px; }
.slider-next { right: 10px; }

/* 10. Product Detail Expand (Read More) */
.product-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
}
.product-detail.expanded {
    max-height: 500px; /* Cukup untuk list fitur panjang */
    opacity: 1;
    margin-top: 1rem;
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    border-top: 1px dashed #e5e7eb;
}

/* 11. Live Sales Badge */
.live-sales-badge {
    animation: pulse-soft 2s infinite;
}
@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.floating-wa {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9990; /* Di atas elemen lain tapi di bawah modal/toast */
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    animation: wa-bounce 2s infinite;
}

.floating-wa:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.floating-wa::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25D366;
    opacity: 0.6;
    z-index: -1;
    animation: wa-pulse 2s infinite;
}

@keyframes wa-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes wa-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

.cursor-blink {
    display: inline-block;
    width: 3px;
    background-color: var(--color-brand);
    animation: blink 1s infinite;
    margin-left: 5px;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ================= 14. 3D TILT EFFECT ================= */
.tilt-card {
    transition: transform 0.1s ease; /* Transisi sangat cepat untuk respon mouse */
    transform-style: preserve-3d;
}

/* ================= 15. SOCIAL PROOF NOTIFICATION ================= */
.sales-notification {
    position: fixed;
    bottom: 200px; /* Di atas tombol WA & Scroll Top */
    left: -400px; /* Tersembunyi di kiri layar */
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9980;
    transition: left 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid #ec4899;
    max-width: 320px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}
.sales-notification.active {
    left: 20px; /* Muncul ke layar */
}
.sales-notification img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fdf2f8;
}

/* ================= 16. GRADIENT TEXT ANIMATION (BARU) ================= */
/* Tambahkan class 'text-gradient-animate' ke elemen h1/h2 yang ingin diberi efek */
.text-gradient-animate {
    background: linear-gradient(
        to right,
        #ec4899 0%,
        #8b5cf6 25%,
        #3b82f6 50%,
        #8b5cf6 75%,
        #ec4899 100%
    );
    background-size: 200% auto;
    color: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* ================= 17. GALLERY RATIO FIX (Mobile & Desktop) ================= */
/* Memaksa gambar galeri agar selalu Kotak (1:1) presisi */
#galeri img {
    aspect-ratio: 1 / 1 !important;
    width: 100%;
    object-fit: cover; /* Agar gambar tidak gepeng, melainkan di-crop rapi */
}

/* Memaksa video galeri agar selalu Landscape (16:9) presisi */
#galeri video, 
#galeri .video-container {
    aspect-ratio: 16 / 9 !important;
    width: 100%;
    height: auto !important; /* Reset height agar mengikuti aspect ratio */
    object-fit: cover;
}

/* ================= 18. EXIT INTENT POPUP ================= */
#exit-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#exit-popup.visible {
    display: flex;
    opacity: 1;
}

.exit-content {
    background: white;
    padding: 2.5rem;
    border-radius: 1.5rem;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 4px solid #fdf2f8; /* Brand-50 border ring */
}

#exit-popup.visible .exit-content {
    transform: scale(1);
}

.exit-close {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
    font-size: 1.5rem;
    background: #f3f4f6;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exit-close:hover {
    color: #ef4444;
    background: #fee2e2;
}