/* ---------- PENJELASAN: CSS ini mengatur tampilan ---------- */
/* Setiap baris seperti baju dan makeup untuk HTML */

/* === GLOBAL STYLE (berlaku untuk semua halaman) === */
* {
    margin: 0; /* hapus jarak luar default */
    padding: 0; /* hapus jarak dalam default */
    box-sizing: border-box; /* biar ukuran total termasuk padding dan border, gampang diatur */
}

body {
    font-family: 'Inter', sans-serif; /* jenis huruf yang modern */
    background-color: #f8f9fa; /* warna latar belakang abu-abu sangat muda */
    color: #2c3e50; /* warna teks utama (biru gelap keabu-abuan) */
    line-height: 1.6; /* jarak antar baris biar nyaman dibaca */
}

/* Container: seperti kotak pembatas, biar konten tidak mepet ke tepi layar */
.container {
    max-width: 1200px; /* lebar maksimal 1200px (pas di laptop/komputer) */
    margin: 0 auto; /* tengah secara horizontal */
    padding: 0 20px; /* kasih jarak kiri kanan 20px */
}

/* === NAVBAR (bagian kepala) === */
.navbar {
    background-color: white; /* warna putih bersih */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* bayangan halus di bawah */
    position: sticky; /* tetap di atas saat di-scroll */
    top: 0;
    z-index: 1000; /* biar di atas konten lain */
}

.navbar-container {
    display: flex; /* anak-anaknya berjejer ke samping */
    justify-content: space-between; /* kiri, tengah, kanan terpisah */
    align-items: center; /* sejajar vertikal tengah */
    padding: 1rem 20px; /* jarak dalam */
}

.logo {
    font-size: 1.8rem; /* ukuran besar */
    font-weight: 800; /* tebal banget */
    color: #e67e22; /* warna oranye seperti ikan koi */
}

.logo i {
    margin-right: 10px; /* jarak ikon dengan teks */
}

.nav-menu {
    display: flex; /* menu berjejer ke samping */
    list-style: none; /* hapus bulatan di depan item */
    gap: 2rem; /* jarak antar menu 2rem */
}

.nav-menu a {
    text-decoration: none; /* hapus garis bawah link */
    color: #2c3e50;
    font-weight: 600;
    transition: color 0.3s; /* animasi halus saat kena hover */
}

.nav-menu a:hover {
    color: #e67e22; /* berubah oranye saat disentuh mouse */
}

.nav-icons {
    display: flex;
    gap: 1.5rem; /* jarak antara ikon keranjang dan login */
    align-items: center;
}

.cart-icon, .login-icon {
    font-size: 1.5rem;
    cursor: pointer; /* jadi tangan saat dihover */
    transition: transform 0.2s;
    position: relative; /* supaya angka keranjang bisa diposisikan di atas */
}

.cart-icon:hover, .login-icon:hover {
    transform: scale(1.1); /* membesar sedikit */
    color: #e67e22;
}

.cart-count {
    position: absolute; /* bebas diletakkan di mana saja relatif ke parentnya */
    top: -8px;
    right: -12px;
    background-color: #e67e22;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%; /* jadi bulat */
}

/* === HERO SECTION (bagian banner megah) === */
.hero {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe6d5 100%); /* gradasi warna oranye muda */
    padding: 4rem 0;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap; /* jika layar kecil, turun ke bawah */
}

.hero-content {
    flex: 1; /* ambil ruang 1 bagian */
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.highlight {
    color: #e67e22; /* kata "Premium" jadi oranye mencolok */
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #5a6e7c;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%; /* biar tidak meluber */
    animation: float 3s ease-in-out infinite; /* gerak naik turun lembut */
}

/* animasi melayang */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* Tombol yang keren */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background-color: #e67e22;
    color: white;
}

.btn-primary:hover {
    background-color: #d35400;
    transform: translateY(-2px); /* naik sedikit saat dihover */
    box-shadow: 0 5px 15px rgba(230,126,34,0.3);
}

/* === BAGIAN PRODUK POPULER === */
.products {
    padding: 5rem 0;
    background-color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #7f8c8d;
}

/* Grid produk: membuat 4 kartu sejajar */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* responsif: minimal 250px per kartu */
    gap: 2rem;
}

/* kartu produk */
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover; /* gambar memenuhi kotak tanpa terdistorsi */
    border-bottom: 3px solid #e67e22;
}

.product-info {
    padding: 1.2rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-price {
    color: #e67e22;
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0.5rem 0;
}

.product-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-cart-btn:hover {
    background: #e67e22;
}

/* === FOOTER === */
.footer {
    background-color: #1a252f;
    color: #ecf0f1;
    padding: 3rem 0 0 0;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.footer-logo i {
    color: #e67e22;
}

.social-icons {
    margin-top: 1rem;
}

.social-icons a {
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #e67e22;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #e67e22;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #2c3e50;
    font-size: 0.9rem;
}

/* === MODAL (jendela pop-up keranjang dan login) === */
.cart-modal, .login-modal {
    display: none; /* disembunyikan dulu sampai dipanggil */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.cart-modal-content, .login-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cart-modal-header, .login-modal-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ddd;
}

.cart-close, .login-close {
    font-size: 2rem;
    cursor: pointer;
}

.cart-modal-body, .login-modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info h4 {
    font-size: 1rem;
}

.cart-item-actions button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.cart-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
}

.btn-checkout {
    background: #27ae60;
    color: white;
    width: 100%;
    margin-top: 1rem;
}

/* Responsif untuk HP */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    .nav-menu {
        display: none; /* sembunyikan menu di HP biar simpel */
    }
    .hero-content h1 {
        font-size: 2rem;
    }
}

/* ========== USER DROPDOWN MENU ========== */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    border-radius: 50px;
    transition: all 0.3s;
}

.user-avatar:hover {
    background: #e67e22;
    color: white;
}

.user-avatar i:first-child {
    font-size: 1.2rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar .fa-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.user-dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
    text-align: center;
}

.dropdown-header strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dropdown-header small {
    font-size: 0.7rem;
    opacity: 0.9;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.dropdown-item i {
    width: 20px;
    font-size: 1rem;
    color: #7f8c8d;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #e67e22;
}

.dropdown-item:hover i {
    color: #e67e22;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.3rem 0;
}

.logout-item {
    color: #e74c3c;
}

.logout-item i {
    color: #e74c3c;
}

.logout-item:hover {
    background: #fee;
    color: #e74c3c;
}

/* Responsif untuk dropdown */
@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-avatar {
        padding: 0.3rem 0.6rem;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    
    .dropdown-menu.show {
        transform: translateY(0);
    }
}