/* reset dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
}

/* navbar */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1200px;
    margin: auto;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #0056b3;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #0056b3;
}

/* dropdown */
.dropdown {
    position: relative;
}

.dropbtn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 150%;
    left: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
    z-index: 1;
}

.dropdown-content.show {
    display: block; 
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #eee;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* tombol login */
.login-btn {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.login-btn:hover {
    background-color: #004494;
}

/* hero */
.hero {
    text-align: center;
    padding: 100px 5%;
    background: linear-gradient(to right, #e0eafc, #cfdef3);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #111;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #555;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons button {
    padding: 12px 24px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-primary { background-color: #0056b3; color: white; }
.btn-secondary { background-color: white; color: #0056b3; border: 1px solid #0056b3 !important; }

/* featured */
.featured {
    padding: 50px 5%;
    max-width: 1200px;
    margin: auto;
}

.featured h2 {
    text-align: center;
    margin-bottom: 30px;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.card-img {
    height: 150px;
    width: 100%;
}

.card-info {
    padding: 15px;
}

.card-info h3 { margin-bottom: 5px; }
.price { font-weight: bold; color: #0056b3; margin-top: 10px; }

footer {
    text-align: center;
    padding: 20px;
    background-color: #222;
    color: white;
    margin-top: 40px;
}

/* --- MODAL STYLING --- */
.modal {
    display: none; /* Sembunyikan secara default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Latar belakang semi-transparan */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.close-btn:hover { color: #333; }

.modal-content h2 { margin-bottom: 20px; text-align: center; }

.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-weight: 500;}
.input-group input { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}

.submit-btn {
    width: 100%;
    padding: 10px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.register-text { text-align: center; margin-top: 15px; font-size: 14px; }
.register-text a { color: #0056b3; text-decoration: none; }

/* responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    .nav-links {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        margin-top: 15px;
        gap: 15px;
    }
    .login-btn {
        width: 100%;
    }
    .dropdown-content {
        position: relative;
        box-shadow: none;
        border-left: 2px solid #0056b3;
        margin-top: 10px;
    }
}

/* --- utk page katalog --- */
.katalog-page {
    padding: 40px 5%;
    max-width: 1200px;
    margin: auto;
    min-height: 70vh; /* Memastikan footer tetap di bawah jika konten sedikit */
}

.katalog-page h1 {
    font-size: 2rem;
    color: #111;
    margin-bottom: 10px;
}

.katalog-desc {
    color: #555;
    margin-bottom: 30px;
    font-size: 1.1rem;
}
/* --- utk page katalog --- */

/* Styling Tampilan Setelah User Login di Navbar */
.user-logged {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.logout-btn {
    background-color: #dc3545; /* Warna merah untuk indikasi keluar/logout */
    color: white !important;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

.logout-btn:hover {
    background-color: #bd2130;
}

/* responsif saat di layar kecil */
@media (max-width: 768px) {
    .user-logged {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 10px;
    }
    .logout-btn {
        width: 100%;
        text-align: center;
    }
}

/* styling tombol nama user di navbar */
.user-profile-btn {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    padding: 5px 10px;
    transition: color 0.3s, background-color 0.3s;
    border-radius: 4px;
}

.user-profile-btn:hover {
    color: #0056b3;
    background-color: #f0f4f8;
}

/* penyesuaian responsif untuk mobile layout */
@media (max-width: 768px) {
    .user-profile-btn {
        width: 100%;
        text-align: left;
        padding: 10px 0;
    }
}

