* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

.background-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.bg-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    /* Ubah 0.5 jadi lebih gelap/terang */
    z-index: 2;
    transition: background 0.5s ease;
}

.fade-out {
    transition: opacity 0.5s ease;
    opacity: 0 !important;
    pointer-events: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.judul {
    text-align: center;
    margin-bottom: 1rem;
}

h2 {
    font-size: 18px;
    font-family: sans-serif;
    color: #2d2d3a;
}

hr {
    border: none;
    border-top: 1px solid #ccc;
    margin-bottom: 1.5rem;
}

.login-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: 90%;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
    display: none;
}


.input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.input-tag {
    background: #2d2d3a;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.toggle-switch {
    margin-left: 0.75rem;
    position: relative;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.slider {
    background-color: #2d2d3a;
}

.toggle-switch input:checked+.slider:before {
    transform: translateX(20px);
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group button {
    width: 100%;
    padding: 1rem;
    background: #2d2d3a;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 1rem;
}

.form-group button:hover {
    background: #1f1f2a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}


.disclaimer {
    font-size: 12px;
    color: #555;
    text-align: center;
    margin-top: 1.5rem;
}

.disclaimer a {
    color: #5bc1fc;
    text-decoration: none;
}

#loadingSpinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader {
    width: 45px;
    aspect-ratio: .75;
    --c: no-repeat linear-gradient(#ffffff 0 0);
    background:
        var(--c) 0% 50%,
        var(--c) 50% 50%,
        var(--c) 100% 50%;
    animation: l7 1s infinite linear alternate;
}

@keyframes l7 {
    0% {
        background-size: 20% 50%, 20% 50%, 20% 50%
    }

    20% {
        background-size: 20% 20%, 20% 50%, 20% 50%
    }

    40% {
        background-size: 20% 100%, 20% 20%, 20% 50%
    }

    60% {
        background-size: 20% 50%, 20% 100%, 20% 20%
    }

    80% {
        background-size: 20% 50%, 20% 50%, 20% 100%
    }

    100% {
        background-size: 20% 50%, 20% 50%, 20% 50%
    }
}

/* === NAVBAR === */
.navbar {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 15px 30px;
    position: fixed;
    height: 6rem;
    top: 20px;
    left: 50px;
    right: 50px;
    border-radius: 12px;
    z-index: 999;
    transition: top 0.3s ease, opacity 0.5s ease;
}

.navbar-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    box-sizing: border-box;
}

.navbar-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
    height: 100%;
    list-style: none;
}

.navbar-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    height: 100%;
}

#navbar {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#navbar.show {
    opacity: 1;
    visibility: visible;
}

/* === BOX / CONTENT === */
.content-box-container {
    position: absolute;
    top: 20%;
    left: 50px;
    right: 50px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.content-box-container.show {
    opacity: 1;
    pointer-events: auto;
}

.box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.box-visible {
    opacity: 1;
}

.box.small {
    height: 125px;
    width: 270px;
    max-width: 270px;
}

.box.large {
    height: 500px;
    width: 90%;
}

#alertBox {
    position: fixed;
    top: 16%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    z-index: 999;
    display: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#smallBox {
    display: flex;
    justify-content: center;
    align-items: center;
}

#smallBoxContent {
    display: flex;
    align-items: center;
    gap: 20px;
    /* jarak antara gambar dan text */
    padding: 10px 30px;
    /* atas-bawah: 10px, kiri-kanan: 20px */
}

#smallBoxContent img {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    flex-shrink: 0;
}

.userInfo {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
}

.username {
    font-weight: bold;
    font-size: 16px;
    color: white;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    max-width: 160px;
    /* sesuaikan aja, tergantung ukuran box */
}

#logoutBtn {
    margin-top: 5px;
    width: 80px;
    padding: 4px 10px;
    background: #e74c3c;
    font-weight: bold;
    color: white;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

#logoutBtn:hover {
    background: #c0392b;
}

#footer {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #ccc;
    text-align: center;
    z-index: 999;
    opacity: 0.8;
}

.produk-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    gap: 50px;
    /* ubah dari 70px ke 60px */
    padding: 20px 75px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Kartu Produk */
.produk-card {
    padding: 20px;
    display: inline-block;
    width: 300px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Gambar produk */
.produk-img {
    width: 80%;
    border-radius: 8px;
}

/* Nama dan harga */
.produk-nama {
    margin: 15px 0;
    font-size: 18px;
    font-weight: bold;
}

.produk-harga {
    font-size: 16px;
    color: #be1e2d;
    font-weight: bold;
    margin-bottom: 1rem;
}

.jumlah-kontrol {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.jumlah-kontrol button {
    padding: 5px 10px;
    background-color: #be1e2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#jumlahProduk {
    margin: 0 10px;
    font-size: 16px;
    font-weight: bold;
}

#beliBtn {
    padding: 10px 20px;
    background-color: #be1e2d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.image-wrapper {
    position: relative;
    display: inline-block;
}

.bonus-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: red;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Timer Diskon */
.timer-container {
    position: absolute;
    top: 725px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.timer-box {
    background-color: rgba(220, 53, 69, 0.85);
    color: white;
    padding: 10px 25px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #ff4757;
    max-width: 90%;
}

.timer-icon {
    font-size: 20px;
    margin-right: 10px;
}

.timer-text {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}

#countdown {
    font-weight: 700;
}

/* === MOBILE SUPPORT === */
@media screen and (max-width: 768px) {

    /* Reset dasar */
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    body {
        font-family: sans-serif;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        height: auto;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .background-container {
        position: relative;
        width: 100vw;
        min-height: 100vh;
        /* Biar cukup tinggi */
        overflow-y: auto;
    }

    .bg-photo {
        width: 100vw;
        height: 100%;
        object-fit: cover;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 2;
        transition: background 0.5s ease;
    }

    .navbar {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        z-index: 1000;
        margin-bottom: 20px;
    }

    .navbar-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }

    .navbar-logo {
        font-size: 1.2rem;
        margin-bottom: 10px;
        margin-top: 10px;
        white-space: nowrap;
    }

    .content-box-container {
        position: absolute;
        top: 120px;
        /* Ganti ini sesuai tinggi navbar + margin */
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 3;
        opacity: 1;
        padding: 0 10px;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        max-width: 500px;
        /* HAPUS: margin-top */
    }

    #smallBox {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    #smallBoxContent {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 10px 20px;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    #smallBoxContent img {
        width: 60px;
        height: 60px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .produk-wrapper {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: flex-start;
        padding: 10px;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        overflow-y: auto;
        box-sizing: border-box;
        gap: 10px;
    }

    #footer {
        opacity: 0;
    }

    * {
        max-width: 100%;
    }

    .timer-container {
            top: 790px; /* Adjust for mobile screens */
        }
        
        .timer-box {
            padding: 8px 15px;
        }
        
        .timer-text {
            font-size: 14px;
        }
        
        .timer-icon {
            font-size: 16px;
        }
    
}