* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input, select, button {
    font-family: 'Poppins', sans-serif;
}


body {
    font-family: 'Poppins', sans-serif;

    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-attachment: fixed; /* opsional: efek keren */
}

/* ================= 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;
}

/* ================= HERO ================= */
.hero {
    background: rgba(245, 241, 230, 0.8);
    color: #174644;
    margin: 20px;
    padding: 30px;
    border-radius: 20px;
    display: flex;
    gap: 60px;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.hero img {
    width: 400px;
    border-radius: 15px;
}

.hero-text {
    max-width: 800px;
    color: #174644;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 🔥 bikin teks turun ke tengah */
}

.btn {
    width: fit-content; /* 🔥 ini kuncinya */
    margin-top: 15px;

    text-decoration: none; 
    display: inline-block;
}

/* ================= 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;
}

/* ================= SECTION ================= */
.section {
    text-align: center;
    padding: 20px;
    color: #F5F1E6;
}

.section h2 {
    margin-top: 15px;     /* 🔥 biar turun dari atas */
    margin-bottom: 30px;  /* 🔥 biar nggak nempel ke produk */
}

/* ================= PRODUCTS ================= */
.products {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* CARD */
.card {
    background: #F5F1E6;
    color: #1E5451;
    padding: 15px;
    border-radius: 20px;
    width: 180px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);

    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;

    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

/* HOVER PRODUK */
.card:hover {
    transform: translateY(-10px) scale(1.05);

    box-shadow:
        0 14px 30px rgba(0,0,0,0.20),
        0 0 18px rgba(211,190,144,0.35);
}

.card img {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.08);
}

.card button {
    background: #D3BE90;
    color: #174644;
    border: none;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
}

.card button:hover {
    background: #c4a76f;
}

/* ================= FOOTER ================= */

.footer {
    width: calc(100% - 40px);

    margin: 30px auto;
    padding: 40px;

    background: rgba(245, 241, 230, 0.96);

    border-radius: 28px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));

    gap: 35px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.12);

    color: #174644;
}

/* BOX */

.footer-box {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* TITLE */

.footer h4 {
    font-size: 24px;
    font-weight: 700;

    position: relative;

    padding-bottom: 10px;
}

.footer h4::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 0;

    width: 45px;
    height: 3px;

    background: #D3BE90;

    border-radius: 10px;
}

/* TEXT */

.footer p {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    font-size: 16px;
    line-height: 1.8;
}

/* ICON */

.footer img {
    width: 28px;
    height: 28px;

    object-fit: contain;

    margin-top: 2px;

    flex-shrink: 0;
}

/* HOVER */

.footer-box {
    transition: 0.3s;
}

.footer-box:hover {
    transform: translateY(-4px);
}

/* ================= 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;
}

/* ================= KERANJANG ================= */
.keranjang-link {
    position: relative;
    display: inline-block;
}

.keranjang-link .text {
    padding-right: 10px;
}

.badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #D3BE90;
    color: #174644;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

/* 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;
    }

    /* ===== PRODUCTS ===== */

    .products {
        gap: 16px;
    }

    .card {
        width: 100%;
        max-width: 320px;
    }

    .card img {
        height: 220px;
    }

    .footer {
        width: calc(100% - 24px);

        padding: 28px 22px;

        gap: 28px;

        border-radius: 22px;
    }

    .footer h4 {
        font-size: 20px;
    }

    .footer p {
        font-size: 14px;
    }
}

/* ================= 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 HALAMAN BERANDA ================= */

/* HERO muncul pelan */
.hero {
    animation: fadeSlideDown 0.8s ease;
}

/* Produk card muncul satu-satu */
.card {
    opacity: 0;
    transform: translateY(25px);
    animation: fadeUp 0.6s ease forwards;
}

/* delay produk */
.card:nth-child(1) { animation-delay: 0.2s; }
.card:nth-child(2) { animation-delay: 0.4s; }
.card:nth-child(3) { animation-delay: 0.6s; }
.card:nth-child(4) { animation-delay: 0.8s; }

/* footer muncul */
.footer-box {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.7s ease forwards;
}

.footer-box:nth-child(1) { animation-delay: 1s; }
.footer-box:nth-child(2) { animation-delay: 1.2s; }
.footer-box:nth-child(3) { animation-delay: 1.4s; }

/* tombol hero hover */
.btn:hover {
    transform: scale(1.05);
}

/* animasi */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= ANIMASI SCROLL ================= */

/* kondisi awal */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

/* saat muncul */
.scroll-animate.show {
    opacity: 1;
    transform: translateY(0);
}