/* ======================== */
/* 1. GLOBAL RESET & VARS */
/* ======================== */
:root {
    --color-primary: #800000;   /* Merah Marun */
    --color-accent: #D4AF37;    /* Emas */
    --color-text: #333333;      
    --color-bg: #FAF5E6;        /* Krem */
    --color-white: #ffffff;
    --font-main: 'Montserrat', sans-serif;
    
    /* Increased container width for more space */
    --container-width: 1400px; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    max-width: 100%;
    overflow-x: hidden !important; /* Paksa tidak ada scroll samping */
    width: 100%;
    position: relative; /* Penting untuk layout stabil */
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    padding-top: 85px; 
    overflow-x: hidden;
    width: 100%;
    opacity: 0; 
    animation: pageFadeIn 0.8s ease-out forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        /* HAPUS baris transform: translateY(...) ini agar Navbar AMAN */
    }
    to {
        opacity: 1;
    }
}

body.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease; /* Hapus transform di sini juga */
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 30px; /* Slightly more padding on sides */
    width: 100%;
}

/* ======================== */
/* 2. NAVBAR GLOBAL (WIDER LAYOUT) */
/* ======================== */
.header {
    position: fixed; top: 0; left: 0; width: 100%; height: 85px;
    z-index: 1000; background: var(--color-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex; align-items: center;
}

.header .container {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: 100%;
}

/* DIV 1: BRANDING (KIRI) */
.nav-brand {
    /* Fixed width or flex-basis to prevent shrinking */
    flex: 0 0 auto; 
    display: flex; align-items: center;
    margin-right: 20px;
}
.logo-container { display: flex; align-items: center; gap: 12px; }
.logo-image { height: 50px; width: auto; }
.logo-text {
    font-size: 1.5rem; font-weight: 800; color: var(--color-primary);
    margin-top: 4px; letter-spacing: 0.5px; line-height: 1;
}

/* DIV 2: MENU LINKS (TENGAH) */
.nav-center {
    flex: 1; /* Allow it to take available space */
    display: flex; justify-content: center; align-items: center;
    gap: 30px; /* Good gap between links */
}
.nav-link {
    font-weight: 700; font-size: 0.95rem; color: #444;
    text-transform: uppercase; position: relative; padding: 5px 0;
    white-space: nowrap; /* Prevent text wrapping */
    
}
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.nav-link::after {
    content: ''; position: absolute; width: 0; height: 3px;
    bottom: -2px; left: 50%; background: var(--color-accent);
    transition: 0.3s; transform: translateX(-50%); border-radius: 2px;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* DIV 3: KANAN (CART + USER + LOGOUT) */
.nav-right {
    flex: 0 0 auto; /* Prevent shrinking */
    display: flex; justify-content: flex-end; align-items: center;
    margin-left: 20px;
}

.nav-user-section {
    display: flex; align-items: center; 
    gap: 20px; /* Space between cart, user, logout */
}

/* Cart Button */
.cart-btn-wrapper {
    position: relative; width: 45px; height: 45px;
    background: #fff; border: 1px solid #eee; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    color: var(--color-primary); cursor: pointer; transition: 0.3s;
}
.cart-btn-wrapper:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.cart-badge {
    position: absolute; top: -5px; right: -5px;
    background: var(--color-accent); color: white;
    font-size: 0.75rem; font-weight: 800; width: 22px; height: 22px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* User Profile Btn */
.user-profile-btn {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 0.95rem; color: var(--color-primary);
    padding: 8px 18px; border-radius: 30px;
    transition: 0.3s; border: 1px solid transparent; background: #f9f9f9;
    white-space: nowrap;
    
}
.user-profile-btn:hover { background: #eee; border-color: #ddd; }
.user-profile-btn i { font-size: 1.4rem; color: var(--color-primary); }

/* Logout Button */
.btn-logout-nav {
    border: none; background: none; color: #aaa;
    font-size: 1.4rem; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; margin-left: 5px;
}
.btn-logout-nav:hover { color: var(--color-primary); transform: scale(1.1); }

/* Mobile Toggle */
.menu-toggle { display: none; font-size: 1.8rem; color: var(--color-primary); background: none; border: none; }

/* ======================== */
/* 3. RESPONSIVE MOBILE FIX */
/* ======================== */
@media (max-width: 992px) {
    .header { height: 75px; }
    body { padding-top: 75px; }
    .container { padding: 0 15px; }

    /* 1. Logo Text ALWAYS Visible & Aligned */
    .nav-brand { flex: 1; } /* Let brand take space on mobile */
    .logo-text { display: block !important; font-size: 1.3rem; }
    .logo-image { height: 40px; }

    /* 2. Menu Center Hidden */
    .nav-center {
        position: absolute; top: 75px; left: 0; width: 100%;
        background: white; flex-direction: column; padding: 30px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1); display: none;
        gap: 20px; text-align: center; border-top: 1px solid #eee;
    }
    .nav-center.is-open { display: flex; animation: slideDown 0.3s ease; }

    /* 3. Right Section Mobile Adjustments */
    .nav-right { margin-left: auto; gap: 15px; }
    .nav-user-section { gap: 12px; }

    /* Mobile User Button: Merah Marun BG + Cream Text */
    .user-profile-btn {
        background-color: var(--color-primary) !important;
        color: var(--color-bg) !important; /* Cream Text */
        padding: 8px 12px; border-radius: 8px; font-size: 0.9rem;
    }
    .user-profile-btn i { color: var(--color-bg) !important; font-size: 1.2rem; }
    /* Hide text on very small screens if needed, otherwise keep it */
    @media (max-width: 480px) {
        .user-profile-btn span { display: none; }
        .user-profile-btn { padding: 8px; border-radius: 50%; }
    }

    /* Mobile Cart */
    .cart-btn-wrapper { width: 38px; height: 38px; font-size: 1.1rem; border: none; background: transparent; }
    .cart-btn-wrapper:hover { background: transparent; color: var(--color-primary); }

    /* Hide Desktop Logout on Mobile Header (move to menu if needed or keep hidden) */
    .btn-logout-nav { display: none; } 

    .menu-toggle { display: block; margin-left: 10px; }
}

@keyframes slideDown { from {opacity:0; transform:translateY(-10px);} to {opacity:1; transform:translateY(0);} }

/* Footer & Modal (No changes needed here based on request) */
/* assets/css/global.css - BAGIAN FOOTER */

/* ... (Kode CSS Navbar & Body di atasnya biarkan saja) ... */

/* ========================
   4. FOOTER GLOBAL (FINAL)
   ======================== */
.footer {
    background-color: #800000; /* Merah Marun */
    color: white;
    padding-top: 70px;
    margin-top: 0; /* Hapus margin auto biar nempel */
    position: relative;
    z-index: 10;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr; /* Kolom 1 lebih lebar untuk Branding */
    gap: 40px;
    padding-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Kolom 1: Branding & Sosmed */
.footer-branding .logo-image-footer {
    height: 60px;
    width: auto;
    margin-bottom: 20px;
    filter: brightness(0) invert(1); /* Logo jadi putih */
}

.brand-description {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.85;
    margin-bottom: 25px;
    max-width: 350px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    background: #D4AF37; /* Emas saat hover */
    color: #800000;
    transform: translateY(-3px);
}

/* Kolom 2: Navigasi */
.footer h4 {
    color: #D4AF37; /* Emas */
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a {
    color: white; opacity: 0.8; text-decoration: none; transition: 0.3s;
    font-size: 0.95rem;
}
.footer-links a:hover {
    color: #D4AF37; opacity: 1; padding-left: 5px;
}

/* Kolom 3: Kontak */
.footer-contact .contact-item {
    display: flex; align-items: flex-start; gap: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}
.footer-contact i {
    color: #D4AF37; font-size: 1.1rem; margin-top: 3px;
}

/* Copyright */
.footer-copyright {
    background-color: #600000; /* Merah lebih gelap */
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* RESPONSIVE FOOTER */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Stack ke bawah */
        gap: 40px;
        text-align: center;
    }
    
    .footer-branding {
        display: flex; flex-direction: column; align-items: center;
    }
    
    .social-links { justify-content: center; }
    
    .footer-contact .contact-item {
        justify-content: center; text-align: center;
    }
}
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 9999; display: none; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }
.custom-modal-box { background: #FAF5E6; padding: 30px; border-radius: 15px; text-align: center; width: 90%; max-width: 400px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); border: 2px solid #800000; }
.modal-icon-warning { font-size: 3rem; color: #800000; margin-bottom: 15px; }
.modal-title { font-size: 1.5rem; color: #800000; margin-bottom: 10px; font-weight: 800; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.btn-modal-cancel { background: #ddd; color: #333; padding: 10px 20px; border-radius: 50px; border: none; cursor: pointer; font-weight: bold; }
.btn-modal-confirm { background: #800000; color: white; padding: 10px 20px; border-radius: 50px; border: none; cursor: pointer; font-weight: bold; }
@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

/* Container Toast */
#toast-container {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 10000; /* Di atas segalanya */
    right: 30px;
    top: 30px;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.5s, top 0.5s;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Warna Toast Sukses */
#toast-container.success {
    background-color: #198754; /* Hijau */
    visibility: visible;
    opacity: 1;
    top: 50px; /* Efek turun sedikit */
}

/* Warna Toast Error */
#toast-container.error {
    background-color: #dc3545; /* Merah */
    visibility: visible;
    opacity: 1;
    top: 50px;
}

/* --- PINDAHAN DARI INDEX.CSS (AGAR TOMBOL LOGIN KONSISTEN) --- */
.btn-primary {
    background-color: #800000; 
    color: white; 
    padding: 15px 40px;
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 1.1rem; 
    display: inline-block;
    transition: 0.3s; 
    border: 2px solid transparent; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-decoration: none; /* Penting untuk tag <a> */
}

.btn-primary:hover { 
    background-color: #600000; 
    transform: translateY(-3px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.4); 
    color: white;
}