* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input, select, button {
    font-family: 'Poppins', sans-serif;
}

html, body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;

    background: 
        linear-gradient(rgba(30,84,81,0.85), rgba(30,84,81,0.85)), /* 🔥 warna overlay */
        url('/images/bg4.webp'); /* 🔥 gambar */

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; 
}

/* ================= NAVBAR ================= */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 40px;
    background: #1E5451;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 0 0 20px 20px;
}

/* LOGO */
.logo {
    display: flex;
    align-items: center;
    flex: 1;
}

.logo img {
    height: 75px;       /* lebih proporsional */
    margin-left: 10px;  /* biar nggak nempel kiri */
}

/* MENU */
.menu {
    display: flex;
    gap: 30px;
    list-style: none;
    font-weight: 600;
    flex: 2;
    justify-content: center;
    align-items: center;
}

.menu a {
    text-decoration: none;
    color: #F5F1E6;
    padding: 6px 12px;
    border-radius: 8px;
    transition: 0.3s;
}

.menu a:hover {
    color: #D3BE90;
}

.menu .active {
    background: #F5F1E6;
    color: #174644;
}

/* USER */
.user {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.user span {
    color: #F5F1E6;
}

/* ================= BUTTON ================= */
.btn, .logout-btn {
    background: #D3BE90;
    color: #174644;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
}

.btn:hover, .logout-btn:hover {
    background: #c4a76f;
}

/* ================= LOGIN BUTTON ================= */
.login-btn {
    background: #D3BE90;
    color: #174644;
    padding: 6px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
}

.login-btn:hover {
    background: #c4a76f;
}

/* REGISTER */
.register-btn {
    background: transparent;
    color: #F5F1E6;

    text-decoration: none; 
    display: inline-block;
}

.register-btn:hover {
    color: #D3BE90;
}

/* ================= CONTAINER ================= */
.container {
    padding: 30px;
    text-align: center;
    min-height: 100vh;
}

.container h2 {
    margin-bottom: 20px;
    color: #F5F1E6;
}

/* ================= SEARCH ================= */
.search-box {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.search-box input {
    padding: 10px;
    width: 250px;
    border-radius: 10px;
    border: 1px solid #ddd;
    outline: none;
}

.search-box {
    position: relative;
}

.dropdown-custom {
    position: relative;
    width: 150px;
    cursor: pointer; 
}

.dropdown-selected {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.dropdown-list {
    display: none;
    position: absolute;
    top: 110%;
    width: 100%;
    background: #F5F1E6;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    list-style: none;
    padding: 8px 12px;
    font-size: 13px;
    z-index: 10;
}

.dropdown-list li {
    padding: 10px;
}

.dropdown-list li:hover {
    background: #F5F1E6;
    color: #c9a46c;
}

.dropdown-custom.active .dropdown-list {
    display: block;
}

/* ================= PRODUK GRID ================= */
.produk {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    padding: 0 20px;
}

/* ================= CARD ================= */
.card {
    background: #f4efe7;
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: 0.3s;
}

.card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
}

.card p {
    margin: 10px 0 5px;
    font-weight: 600;
    color: #174644;
}

.card span {
    color: #174644;
    font-size: 14px;
    font-weight: bold;
}

.card-link {
    text-decoration: none;
    color: inherit;
}

/* ================= POPUP ================= */
.popup {
    display: none; /* penting biar tidak nutup katalog */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);

    justify-content: center;
    align-items: center;
    z-index: 999;
}

/* isi popup */
.popup-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 700px;
    max-width: 90%;
    position: relative;

    animation: fadeIn 0.3s ease;
}

/* animasi */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* tombol close */
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
}

/* ================= DETAIL PRODUK (POPUP) ================= */
.popup .produk-card {
    display: flex;
    gap: 20px;
    align-items: center;
}

.popup .produk-img img {
    width: 250px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
}

.popup .produk-info {
    flex: 1;
    text-align: left;
}

.popup .harga {
    color: #c9a46c;
    font-weight: 600;
    margin: 10px 0;
}

.popup .deskripsi {
    font-size: 14px;
    color: #555;
}

/* JUMLAH */
.jumlah {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.jumlah button {
    width: 35px;
    height: 35px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 5px;
}

.jumlah input {
    width: 45px;
    text-align: center;
    height: 35px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* TOMBOL */
.tombol {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.btn-kembali {
    border: 1px solid #c9a46c;
    padding: 8px 14px;
    border-radius: 6px;
    background: none;
    cursor: pointer;
}

.btn-tambah {
    background: #D3BE90;
    color: #174644;
    font-weight: bold;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-tambah:hover {
    background: #b8935f;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
    .produk {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .produk {
        grid-template-columns: repeat(2, 1fr);
    }

    .popup .produk-card {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .produk {
        grid-template-columns: 1fr;
    }
}

/* ================= POPUP KONFIRMASI ================= */

.popup-confirm{
    display:none;
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;

    background:rgba(0,0,0,0.35);
    backdrop-filter: blur(3px);

    justify-content:center;
    align-items:center;
    z-index:1000;
}

.confirm-box{
    background:#f4efe7;
    padding:30px;
    width:320px;
    border-radius:20px;
    text-align:center;

    box-shadow:0 10px 30px rgba(0,0,0,0.2);
}

.confirm-box h3{
    margin-bottom:20px;
    color:#2c3e3e;
}

.confirm-btn{
    display:flex;
    justify-content:center;
    gap:12px;
}

.btn-batal{
    background:#d9d9d9;
    border:none;
    padding:8px 18px;
    border-radius:10px;
    cursor:pointer;
}

.btn-ya{
    background:#c9a46c;
    color:white;
    border:none;
    padding:8px 18px;
    border-radius:10px;
    cursor:pointer;
}

.btn-ya:hover{
    background:#b8935f;
}

.popup.hide .popup-content {
    animation: none !important;
}

.keranjang-link {
    position: relative;
    display: inline-block; /* ganti dari flex */
}

.keranjang-link .text {
    padding-right: 10px;
}

.badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #c9a46c;
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.popup .produk-info h2{
    color: #174644;
}

/* HAMBURGER */
.hamburger {
    display: none;
    font-size: 30px;
    color: #F5F1E6;
    cursor: pointer;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    body {
        background:
            linear-gradient(rgba(30,84,81,0.90), rgba(30,84,81,0.90)),
            url('/images/bg4.webp');

        background-size: cover;
        background-position: center;
        background-repeat: repeat-y;
    }

    /* ===== NAVBAR ===== */

    .navbar {
        position: relative;

        width: 100%;

        display: grid;

        grid-template-columns: 1fr auto;

        grid-template-areas:
            "logo user"
            "hamburger user"
            "menu menu";

        align-items: start;

        padding: 14px 16px;

        border-radius: 0 0 24px 24px;
    }

    /* LOGO */

    .logo {
        grid-area: logo;

        justify-content: flex-start;
    }

    .logo img {
        height: 70px;
        margin: 0;
    }

    /* HAMBURGER */

    .hamburger {
        grid-area: hamburger;

        display: flex;

        margin-top: 2px;
        margin-left: 18px;

        font-size: 38px;
    }

    /* MENU */

    .menu {
        grid-area: menu;

        width: 100%;

        display: none;

        flex-direction: column;

        gap: 12px;

        margin-top: 18px;

        padding: 0;
    }

    .menu.show {
        display: flex;
    }

    .menu li {
        width: 100%;
        list-style: none;
    }

    .menu a {

        width: 100%;

        display: flex;

        justify-content: center;
        align-items: center;

        padding: 15px;

        font-size: 15px;

        background: rgba(255,255,255,0.07);

        border-radius: 16px;
    }

    .menu .active {
        background: #F5F1E6;
        color: #174644;
    }

    /* USER */

    .user {
        grid-area: user;

        display: flex;
        align-items: center;

        gap: 12px;

        margin-top: 4px;
    }

    .user span {
        font-size: 15px;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        max-width: 90px;
    }

    .logout-btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    /* ===== HERO ===== */

    .hero {

        flex-direction: column;

        gap: 20px;

        text-align: center;

        margin: 16px;

        padding: 22px;
    }

    .hero img {
        width: 100%;
        max-width: 320px;
    }

    .hero-text {
        align-items: center;
    }

    .hero-text h1 {
        font-size: 28px;
    }

    .hero-text p {
        font-size: 14px;
    }

    /* ===== SECTION ===== */

    .section {
        padding: 16px;
    }

    .section h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    /* ===== PRODUK KATALOG ===== */

    .produk {

        display: grid !important;

        grid-template-columns: repeat(2, 1fr) !important;

        gap: 12px;

        padding: 0;
    }

    .card-produk {

        width: 100% !important;

        max-width: 100% !important;

        padding: 12px;

        border-radius: 16px;
    }

    .card-produk img {

        width: 100%;

        height: 120px;

        object-fit: cover;

        border-radius: 12px;
    }

    .card-produk h3 {
        font-size: 14px;
        margin-top: 8px;
    }

    .card-produk p {
        font-size: 13px;
    }

    .card small {
        font-size: 12px;
    }

    /* ===== SEARCH + FILTER MOBILE ===== */

    .search-box {

        display: flex;

        flex-direction: column;

        gap: 12px;

        width: 100%;
    }

    /* SEARCH */

    .search-box input {

        width: 100%;

        padding: 12px 16px;

        border-radius: 16px;

        border: none;

        font-size: 14px;
    }

    /* FILTER */

    .dropdown-custom {

        width: fit-content;

        align-self: flex-end;
    }

    .dropdown-selected {

        background: #D3BE90;

        color: #174644;

        padding: 10px 16px;

        border-radius: 999px;

        font-size: 13px;

        font-weight: 600;

        display: flex;

        align-items: center;

        gap: 8px;

        box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    }

    /* PANAH MODERN */

    .dropdown-selected::after {

        content: "";

        width: 8px;

        height: 8px;

        border-right: 2px solid #174644;

        border-bottom: 2px solid #174644;

        transform: rotate(45deg);

        transition: 0.3s;

        margin-top: -4px;
    }

    .dropdown-custom.active .dropdown-selected::after {

        transform: rotate(225deg);

        margin-top: 2px;
    }

    /* LIST */

    .dropdown-list {

        margin-top: 8px;

        border-radius: 16px;

        overflow: hidden;

        background: #F5F1E6;

        min-width: 170px;
    }

    .dropdown-list li {

        padding: 12px 16px;

        font-size: 13px;
    }

    /* ===== FOOTER ===== */

    .footer {

        flex-direction: column;

        gap: 18px;

        margin: 16px;

        padding: 24px;
    }

    .footer p {
        justify-content: center;
        text-align: center;
    }
}

/* ================= POPUP LOGOUT ================= */
.popup-overlay{
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;

    background: rgba(0,0,0,0.5);

    display:none;
    justify-content:center;
    align-items:center;

    z-index:9999;
}

.popup-box{
    background:#F5F1E6;
    width:320px;
    padding:30px;

    border-radius:20px;
    text-align:center;

    box-shadow:0 10px 25px rgba(0,0,0,0.2);
}

.popup-box h3{
    color:#174644;
    margin-bottom:10px;
}

.popup-box p{
    color:#555;
    margin-bottom:25px;
}

.popup-buttons{
    display:flex;
    justify-content:center;
    gap:15px;
}

.btn-yes,
.btn-no{
    border:none;
    padding:10px 22px;
    border-radius:12px;

    cursor:pointer;
    font-weight:600;

    transition:0.3s;
}

.btn-yes{
    background:#D3BE90;
    color:#174644;
}

.btn-yes:hover{
    background:#c4a76f;
}

.btn-no{
    background:#d9d9d9;
    color:#333;
}

.btn-no:hover{
    background:#c5c5c5;
}

/* ================= ANIMASI PRODUK ================= */
.card-produk {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-produk:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= ANIMASI PRODUK SAJA ================= */
.card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

/* biar muncul satu-satu */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
