/* RESET & FONT */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
:root { --bg: #0b0e14; --card: #151a23; --primary: #00d2ff; --accent: #a855f7; --text: #ffffff; }
body { background: var(--bg); color: var(--text); padding-bottom: 50px; }
.text-purple { color: var(--accent); }
.text-outline { -webkit-text-stroke: 1px var(--primary); color: transparent; }

/* HEADER */
header { background: rgba(11, 14, 20, 0.95); padding: 15px 5%; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #1e293b; display: flex; justify-content: center; }
.nav-container { width: 100%; max-width: 1200px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; cursor: pointer; }
.search-box { 
    position: relative; 
    /* === TAMBAHAN INI === */
    display: flex; /* Mengatur input dan button dalam satu baris */
    align-items: center; /* Memastikan vertikalnya rata tengah */
    /* ==================== */
}
.search-box input { 
    background: var(--card); 
    border: 1px solid #334155; 
    padding: 8px 15px; 
    border-radius: 20px; 
    color: white; 
    width: 300px; /* Lebar default desktop */
    outline: none; 
    flex-grow: 1; /* Pastikan input mengambil ruang maksimum */
    padding-right: 40px; /* Beri ruang agar icon button tidak menutupi teks */
}
.search-box button {
    /* Posisikan tombol agar berada di dalam kotak input */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 10px;
}
.nav-menu { display: flex; align-items: center; gap: 20px; }
.nav-link { text-decoration: none; color: white; font-weight: 600; cursor: pointer; }
.cart-btn { background: var(--primary); color: #000; padding: 5px 15px; border-radius: 20px; text-decoration: none; font-weight: bold; }

/* DROPDOWN */
.user-menu { position: relative; }
.dropdown { display: none; position: absolute; top: 35px; right: 0; background: var(--card); border: 1px solid #334155; min-width: 150px; border-radius: 8px; overflow: hidden; z-index: 200; }
.dropdown.active { display: block; }
.dropdown a { display: block; padding: 12px; color: #ff4444; text-decoration: none; font-weight: bold; }
.dropdown a:hover { background: rgba(255, 255, 255, 0.05); }

/* HERO */
.hero-neon { height: 400px; margin: 20px 5%; border-radius: 20px; background: linear-gradient(to right, rgba(11,14,20,0.9), rgba(11,14,20,0.4)), url('https://images.unsplash.com/photo-1542751371-adc38448a05e?q=80&w=1920'); background-size: cover; background-position: center; display: flex; align-items: center; padding-left: 5%; border: 1px solid rgba(168, 85, 247, 0.3); }
.neon-title { font-size: 3rem; font-weight: 900; line-height: 1.2; margin-bottom: 20px; color: white; text-shadow: 0 0 20px rgba(0, 210, 255, 0.5); }
.hero-desc { font-size: 1.1rem; color: #cbd5e1; max-width: 500px; line-height: 1.6; margin-bottom: 30px; }
.cta-btn { padding: 12px 30px; background: var(--primary); color: black; font-weight: bold; border: none; border-radius: 50px; cursor: pointer; transition: 0.3s; box-shadow: 0 0 20px rgba(0, 210, 255, 0.4); }
.cta-btn:hover { transform: scale(1.05); background: white; }

/* CATEGORY */
.category-section { display: flex; justify-content: center; gap: 20px; margin-top: -50px; position: relative; z-index: 10; flex-wrap: wrap; }
.cat-item { background: rgba(21, 26, 35, 0.95); padding: 20px; border-radius: 15px; border: 1px solid #334155; cursor: pointer; width: 220px; display: flex; align-items: center; gap: 15px; transition: 0.3s; backdrop-filter: blur(10px); }
.cat-item:hover { transform: translateY(-5px); border-color: var(--primary); }
.cat-item img { width: 40px; }
.cat-item h3 { font-size: 1rem; color: var(--primary); }
.cat-item p { font-size: 0.8rem; color: #94a3b8; }

/* TESTIMONIALS & NEWSLETTER */
.testimonials { padding: 80px 5%; text-align: center; }
.testimonials h2 { font-size: 2rem; margin-bottom: 40px; color: white; }
.testi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.testi-card { background: var(--card); padding: 30px; border-radius: 20px; border: 1px solid #334155; text-align: left; transition: 0.3s; display: flex; flex-direction: column; justify-content: space-between; }
.testi-card:hover { border-color: var(--accent); transform: translateY(-5px); }
.stars { margin-bottom: 15px; }
.testi-card p { color: #cbd5e1; font-style: italic; margin-bottom: 25px; line-height: 1.6; }
.user-info { border-top: 1px solid #334155; padding-top: 15px; margin-top: auto; }
.user-info h4 { font-size: 1rem; color: white; font-weight: 700; }
.user-info span { font-size: 0.85rem; color: var(--primary); font-weight: 500; }

.newsletter { padding: 60px 5%; background: #0f1116; border-top: 1px solid #1e293b; text-align: center; margin-top: 50px; }
.newsletter h2 { color: var(--accent); margin-bottom: 10px; }
.newsletter-form { margin-top: 20px; display: flex; justify-content: center; gap: 10px; }
.newsletter-form input { padding: 10px 20px; border-radius: 50px; background: var(--card); border: 1px solid #334155; color: white; width: 300px; outline: none; }
.newsletter-form button { padding: 10px 25px; border-radius: 50px; background: var(--accent); border: none; color: white; font-weight: bold; cursor: pointer; }

/* PAGE VIEW & GRID */
.page-header { background: var(--card); padding: 30px 5%; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid #334155; margin-bottom: 30px; }
.back-btn { background: transparent; border: 1px solid var(--primary); color: var(--primary); padding: 8px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.back-btn:hover { background: var(--primary); color: #000; }
.product-section { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 25px; }
.card { background: var(--card); border: 1px solid #2d3748; border-radius: 15px; padding: 15px; text-align: center; transition: 0.3s; animation: popUp 0.5s ease-out; }
.card:hover { transform: translateY(-5px); border-color: var(--primary); }
.card img { width: 100%; height: 120px; object-fit: contain; margin-bottom: 15px; }
.btn-buy { width: 100%; padding: 10px; border: none; border-radius: 8px; background: #1e293b; color: white; cursor: pointer; font-weight: 600; transition: 0.3s; }
.btn-buy:hover { background: var(--primary); color: #000; }
@keyframes popUp { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* OVERLAYS & WIDGETS */
.chat-widget { position: fixed; bottom: 20px; right: 20px; z-index: 1000; }
.chat-btn { width: 60px; height: 60px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; cursor: pointer; animation: bounce 2s infinite; }
.chat-box { display: none; width: 300px; background: var(--card); border: 1px solid #334155; border-radius: 15px; position: absolute; bottom: 70px; right: 0; }
.chat-box.active { display: block; }
.chat-body { height: 200px; padding: 10px; overflow-y: auto; background: #0b0e14; }
.chat-footer { padding: 10px; display: flex; }
.chat-footer input { flex: 1; padding: 5px; border-radius: 5px; border: none; margin-right: 5px; }

.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; display: none; align-items: center; justify-content: center; }
.overlay.active { display: flex; }
.auth-box { background: var(--card); padding: 30px; border-radius: 15px; width: 350px; border: 1px solid var(--primary); text-align: center; position: relative; }
.auth-box input { width: 100%; padding: 12px; margin-bottom: 10px; background: var(--bg); border: 1px solid #334155; color: white; border-radius: 8px; }
.auth-submit { width: 100%; padding: 12px; border: none; border-radius: 8px; background: var(--primary); font-weight: bold; cursor: pointer; margin-top: 10px; }
.close-btn { position: absolute; top: 10px; right: 15px; cursor: pointer; font-size: 1.5rem; }
#toast { position: fixed; top: -100px; left: 50%; transform: translateX(-50%); background: var(--card); padding: 12px 25px; border-radius: 50px; border: 1px solid var(--primary); z-index: 3000; transition: 0.5s; font-weight: 600; }
#toast.show { top: 30px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }


/* ================= MEDIA QUERIES (RESPONSIVE HP) - FIX AKHIR ================= */

@media (max-width: 768px) {
    /* 1. HEADER */
    header {
        padding: 10px 5%; 
    }
    .nav-container {
        flex-direction: column; 
        gap: 10px; /* Kurangi jarak vertikal */
        align-items: center; /* Pastikan semua di tengah horizontal */
    }
    
    /* Logo: Baris 1, pasti di tengah */
    .logo {
        order: 1; 
        width: 100%;
        justify-content: center; 
        gap: 8px;
    }

    /* Menu Login/Cart: Baris 2, lebarnya disesuaikan konten */
    .nav-menu {
        order: 2;
        gap: 15px;
        /* Hapus width: 100% agar tidak memanjang */
        justify-content: center; 
    }
    .cart-btn {
        padding: 5px 12px; /* Kecilkan sedikit tombol cart */
    }
    .nav-link {
        font-size: 0.95rem; /* Kecilkan teks login */
    }

    /* Search Box: Baris 3, lebar fix 90% */
    .search-box {
        order: 3; 
        width: 90%; 
        max-width: none; 
        margin: 0 auto; 
    }
    .search-box input {
        width: 100%;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    /* 2. HERO BANNER */
    .hero-neon {
        height: 300px; /* Lebih pendek di HP */
        padding-left: 10%;
        margin: 15px 5%;
    }
    .neon-title {
        font-size: 2rem;
    }
    .hero-desc {
        font-size: 0.9rem;
    }
    .cta-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* 3. KATEGORI */
    .category-section {
        flex-direction: column; 
        gap: 10px;
        margin-top: -20px;
        align-items: center;
    }
    .cat-item {
        width: 90%; 
        padding: 12px;
    }
    .cat-item img {
        width: 40px !important; /* Kecilkan ikon kategori */
        height: 40px !important;
    }
    .cat-item h3 {
        font-size: 0.95rem;
    }

    /* 4. GRID PRODUK */
    .product-section {
        padding: 0 5%;
    }
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
        gap: 10px;
    }
    .card {
        padding: 10px;
    }
    .card img {
        height: 80px;
    }

    /* 5. TESTIMONIALS & NEWSLETTER */
    .testimonials, .newsletter {
        padding: 40px 5%;
    }
}