:root {
    /* TEMA DEFAULT: PUTIH SOFT */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-green: #16a34a;
    --danger: #ef4444;
    
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* TEMA GELAP: HITAM GALAKSI */
[data-theme="dark"] {
    --bg-main: #0B0E14; /* Hitam kebiruan pekat ala angkasa */
    --bg-card: #151A24; /* Sedikit lebih terang untuk elemen card */
    --bg-nav: rgba(11, 14, 20, 0.85);
    --border-color: #232D3F;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --accent-blue: #60A5FA; /* Biru galaksi yang bersinar terang */
    --accent-green: #22C55E;
    
    /* Efek shadow sedikit glow/neon agar terlihat ala galaksi */
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(96, 165, 250, 0.05);
    --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 0 30px rgba(96, 165, 250, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-family: 'Inter', sans-serif; background-color: var(--bg-main); color: var(--text-primary); scroll-behavior: smooth; transition: background-color 0.4s ease, color 0.4s ease; }
body { line-height: 1.6; overflow-x: hidden; }
.container { width: 92%; max-width: 1200px; margin: 0 auto; }

/* NAVBAR & NAVIGASI (BARU) */
.navbar { position: sticky; top: 0; left: 0; width: 100%; background: var(--bg-nav); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-color); z-index: 900; transition: var(--transition); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 1rem; }
.nav-brand { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); letter-spacing: -1px; }

.nav-links { display: flex; gap: 0.5rem; flex-grow: 1; justify-content: center; }
.nav-tab { background: transparent; border: none; padding: 0.5rem 1rem; color: var(--text-secondary); font-family: inherit; font-size: 0.95rem; font-weight: 600; border-radius: 20px; cursor: pointer; transition: var(--transition); white-space: nowrap; }
.nav-tab:hover { color: var(--text-primary); }
.nav-tab.active { background: var(--text-primary); color: var(--bg-main); box-shadow: var(--shadow-sm); }

/* TOMBOL THEME TOGGLE */
.theme-toggle { background: var(--bg-card); border: 1px solid var(--border-color); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-primary); cursor: pointer; transition: var(--transition); flex-shrink: 0; }
.theme-toggle:hover { transform: scale(1.1); box-shadow: var(--shadow-md); }

/* HERO */
.hero-section { padding: 3rem 0 2rem; text-align: center; }
.hero-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -1px; }
.hero-tagline { font-size: 1rem; color: var(--accent-blue); font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px;}
.hero-desc { color: var(--text-secondary); max-width: 600px; margin: 0 auto; font-size: 0.95rem; }

/* SECTIONS */
.section { padding: 1rem 0 4rem; }

/* GRID & CARDS */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }
.product-card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; cursor: pointer; box-shadow: var(--shadow-sm); }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent-blue); }

.card-image { width: 100%; aspect-ratio: 16 / 9; background-color: var(--border-color); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.product-card:hover .card-image img { transform: scale(1.05); }

.card-content { padding: 1.25rem; display: flex; flex-direction: column; flex-grow: 1; background: var(--bg-card); }
.product-id { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px;}
.product-title { font-size: 1.1rem; font-weight: 700; margin: 0.25rem 0 0.75rem; line-height: 1.4; color: var(--text-primary); }

/* TAGS */
.product-tags { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tag-game { padding: 4px 10px; font-size: 0.75rem; font-weight: 600; border-radius: 8px; background-color: var(--bg-main); color: var(--text-secondary); border: 1px solid var(--border-color); }
.badge { padding: 4px 10px; font-size: 0.75rem; font-weight: 700; border-radius: 8px; }
.badge-success { background-color: rgba(34, 197, 94, 0.15); color: var(--accent-green); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-muted { background-color: var(--bg-main); color: var(--text-muted); border: 1px solid var(--border-color); }

.product-price { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); margin-top: auto; padding-top: 1rem;}

/* TOMBOL */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.25rem; font-size: 0.95rem; font-weight: 600; border-radius: 12px; border: none; cursor: pointer; transition: var(--transition); }
.btn-whatsapp { background-color: var(--accent-green); color: #fff; font-size: 1rem; box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2); }
.btn-whatsapp:hover { background-color: #15803d; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3); }
.btn-block { width: 100%; }
.btn-disabled { background-color: var(--bg-main) !important; color: var(--text-muted) !important; cursor: not-allowed; box-shadow: none !important; border: 1px solid var(--border-color); }
.btn-disabled:hover { transform: none; }

/* FILTER & SEARCH (Hanya ada Search & Dropdown sekarang) */
.filter-wrapper { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }
.search-box { position: relative; width: 100%; }
.search-icon { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { width: 100%; padding: 1rem 1rem 1rem 3rem; background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; color: var(--text-primary); font-family: inherit; font-size: 1rem; box-shadow: var(--shadow-sm); transition: var(--transition); }
.search-box input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15); }

.filter-controls { display: flex; flex-direction: column; gap: 1rem; }
.select-group { display: flex; gap: 0.75rem; width: 100%; }
.select-wrapper { flex: 1; position: relative; }
.select-wrapper::after { content: "▼"; font-size: 0.7rem; color: var(--text-muted); position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
.select-group select { width: 100%; appearance: none; padding: 0.75rem 2.5rem 0.75rem 1rem; background-color: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 12px; font-size: 0.9rem; font-family: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); outline: none; transition: var(--transition); }
.select-group select:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15); }
.select-group select option { background-color: var(--bg-card); color: var(--text-primary); }

/* FOOTER */
.footer { padding: 2rem 0; text-align: center; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--border-color); background: var(--bg-main); }
.empty-state { text-align: center; padding: 4rem 2rem; background: var(--bg-card); border-radius: var(--radius); border: 1px dashed var(--border-color); }
.empty-state h3 { color: var(--text-primary); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-secondary); }

/* MODAL CONTAINER */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.75); backdrop-filter: blur(5px); }

@keyframes modalPop {
    0% { opacity: 0; transform: scale(0.95) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-container { position: relative; background-color: var(--bg-card); border-radius: 20px; width: 95%; max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; z-index: 1001; box-shadow: var(--shadow-modal); opacity: 0; overflow: hidden; border: 1px solid var(--border-color); }
.modal.active .modal-container { animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; background: var(--bg-main); border: 1px solid var(--border-color); width: 36px; height: 36px; border-radius: 50%; color: var(--text-secondary); cursor: pointer; z-index: 1002; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* MODAL BODY */
.modal-body { display: flex; flex-direction: column; width: 100%; height: 100%; overflow-y: auto; }

/* KOTAK GAMBAR */
.product-gallery { width: 100%; padding: 1.25rem; background: var(--bg-main); border-bottom: 1px solid var(--border-color); }
.gallery-viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; background-color: #000; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); }
.gallery-viewport img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-weight: bold; font-size: 1.2rem; transition: var(--transition); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.gallery-nav:hover { background-color: rgba(0,0,0,0.9); transform: translateY(-50%) scale(1.1); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-counter { position: absolute; bottom: 10px; right: 10px; background-color: rgba(0,0,0,0.8); font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; color: white; font-weight: 600; backdrop-filter: blur(4px); }

/* THUMBNAIL */
.gallery-thumbnails { display: flex; gap: 0.75rem; margin-top: 1rem; overflow-x: auto; width: 100%; padding-bottom: 5px; scroll-snap-type: x mandatory; }
.gallery-thumbnails::-webkit-scrollbar { display: none; }
.thumb-item { width: 70px; height: 50px; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; flex-shrink: 0; opacity: 0.5; transition: var(--transition); scroll-snap-align: start;}
.thumb-item:hover { opacity: 1; }
.thumb-item.active { border-color: var(--accent-blue); opacity: 1; box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3); }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }

/* MODAL INFO */
.modal-info { display: flex; flex-direction: column; width: 100%; padding: 1.25rem; flex-grow: 1; background: var(--bg-card); }
.modal-header-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; padding-right: 3rem; }
.modal-id { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.modal-title { font-size: 1.5rem; font-weight: 800; line-height: 1.3; margin-bottom: 0.5rem; color: var(--text-primary); }
.modal-price { font-size: 1.75rem; font-weight: 800; color: var(--accent-blue); margin-bottom: 1.25rem; }

.modal-scroll-area { flex-grow: 1; }
.modal-section { margin-bottom: 1.5rem; }
.modal-section h4 { font-size: 0.95rem; color: var(--text-primary); font-weight: 700; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.modal-section h4::before { content: ""; display: block; width: 4px; height: 14px; background: var(--accent-blue); border-radius: 4px; }

.description-box { background: var(--bg-main); padding: 1.25rem; border-radius: 12px; border: 1px solid var(--border-color); }
#modalDescription { white-space: pre-wrap !important; word-wrap: break-word !important; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* SPESIFIKASI AKUN */
.specs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.spec-item { background-color: var(--bg-main); padding: 0.75rem 1rem; border-radius: 12px; border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 0.25rem; }
.spec-label { color: var(--text-muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;}
.spec-value { font-weight: 700; color: var(--text-primary); font-size: 0.95rem;}

.modal-action { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); background: var(--bg-card); position: sticky; bottom: 0; z-index: 10; }

/* LIGHTBOX */
.lightbox-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.95); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.lightbox-modal.active { display: flex; }
.lightbox-modal img { max-width: 95%; max-height: 95%; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 2.5rem; cursor: pointer; transition: var(--transition); }
.lightbox-close:hover { color: var(--danger); transform: scale(1.1); }

/* DESKTOP LAYOUT (Modal Terbagi Dua) */
@media (min-width: 868px) {
    .filter-controls { flex-direction: row; align-items: center; justify-content: space-between; }
    .select-group { width: auto; min-width: 350px; }
    
    .modal-body { flex-direction: row; overflow: hidden; }
    .product-gallery { width: 50%; height: 100%; border-bottom: none; border-right: 1px solid var(--border-color); overflow-y: auto; }
    .modal-info { width: 50%; height: 100%; overflow-y: auto; padding: 2rem; }
    .modal-header-info { padding-right: 2rem; }
}
