/* Reset Dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Navbar */
.navbar {
    background-color: #EBCD2B;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logo img {
    height: 50px;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    display: flex;            
    align-items: center;      
    text-decoration: none;
    color: #362F1C;
    margin: 0 15px;
    font-size: 20px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #8A7B4D;
}

/* User Profile & Right Header */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    position: relative;
    display: inline-block;
}

.avatar-trigger {
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #362F1C;
}

.avatar-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile Dropdown */
.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 1100;
    overflow: hidden;
    border: 1px solid #eee;
}

.profile-dropdown.show {
    display: block;
    animation: fadeInDropdown 0.2s ease-out;
}

.dropdown-item {
    color: #333333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
    color: #8A7B4D;
}

.dropdown-item.logout {
    border-top: 1px solid #eee;
    color: #cc0000;
}

.dropdown-item.logout:hover {
    background-color: #fff0f0;
    color: #ff0000;
}

.dropdown-item.disabled {
    color: #aaaaaa !important;
    background-color: #fafafa !important;
    cursor: not-allowed !important;
    pointer-events: none; 
}

/* Cart & Badge Regular */
.cart img {
    height: 40px;
}

.cart-container {
    position: relative;
    display: inline-block;
}

/* Floating Cart */
.floating-cart {
    display: none; /* Disembunyikan di desktop */
    position: fixed;
    bottom: 80px; 
    right: 20px;
    background: #EBCD2B;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

.floating-cart img {
    width: 28px;
    height: 28px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4d4d;
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #fff;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        padding: 15px 20px; 
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        align-items: center;
        gap: 15px; 
        position: relative; /* PENTING: Diperlukan agar avatar bisa diposisikan di pojok */
    }
    
    .logo {
        flex: 0 0 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 0;
    }

    .logo img {
        height: 45px; /* DIUBAH: Logo diperbesar */
    }

    .nav-links {
        display: flex;
        align-items: center;
        justify-content: center;
        padding-left: 0; 
        gap: 20px; 
    }

    .nav-links a {
        margin: 0;
        padding: 0;
        font-size: 15px !important;
        font-weight: bold; 
        white-space: nowrap;
    }

    /* DIUBAH: Profile Pic/Avatar DIPOJOKKAN ke kanan atas sejajar logo */
    .header-right {
        display: flex !important;
        align-items: center;
        position: absolute; /* Lepas dari barisan agar bisa mojok */
        top: 65px; /* Mengatur tinggi agar pas sejajar dengan logo */
        right: 20px; /* Mojok kanan pol */
    }
    
    .avatar-trigger {
        width: 38px; 
        height: 38px;
    }
    
    .profile-dropdown {
        top: 50px;
        right: 0;
    }

    /* Sembunyikan keranjang desktop di HP */
    .cart {
        display: none !important;
    }
    
    /* Munculkan floating cart */
    .floating-cart {
        display: flex !important; 
    }
}