/* === LUWES SUPERMARKET APP - ELEGANT VERSION (FIXED LAYOUT) === */

:root {
    --primary: #D7111C;
    /* Merah Standar */
    --primary-dark: #8b0000;
    /* Merah Tua Mewah */
    --primary-orange: #d35400;
    /* Oranye Elegan */
    --accent: #00897B;
    --yellow: #FFD600;
    --bg: #F8F9FA;
    /* Background sedikit lebih terang */
    --white: #FFFFFF;
    --text: #222222;
    --text-light: #666666;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 8px 25px rgba(0, 0, 0, 0.1);
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #333;
    /* Background luar HP */
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* === CONTAINER HP === */
.mobile-container {
    width: 100%;
    max-width: 414px;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* === HEADER (BAGIAN ATAS MERAH) === */
.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 190px;
    /* Ditinggikan agar lega */
    /* Gradasi Mewah: Merah Tua ke Oranye */
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-orange) 100%);
    border-radius: 0 0 30px 30px;
    /* Lengkungan halus */
    z-index: 0;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.3);
}

.app-header {
    position: relative;
    z-index: 10;
    padding: 20px;
    padding-top: 50px;
    /* Memberi ruang untuk status bar */
    color: white;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.store-info {
    display: flex;
    flex-direction: column;
}

.store-label {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 300;
}

.store-name {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-icons {
    display: flex;
    gap: 16px;
}

.icon-btn {
    position: relative;
    font-size: 22px;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.2s;
}

.icon-btn:active {
    transform: scale(0.9);
}

.badge {
    position: absolute;
    top: -5px;
    right: -6px;
    background: var(--yellow);
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--primary-dark);
    /* Border agar kontras */
}

/* Search Bar Mengapung */
.search-bar {
    background: white;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-float);
    /* Efek melayang */
    margin-bottom: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
}

.search-bar i {
    color: #999;
    font-size: 20px;
}

/* === CONTENT AREA === */
.content-area {
    position: relative;
    z-index: 5;
    padding: 20px;
    padding-bottom: 100px;
}

.page-section {
    display: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-section.active {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === PAGE TITLE (CARD STYLE - SOLUSI AGAR TIDAK BERTUMPUK) === */
.page-title {
    background: white;
    color: var(--primary);
    padding: 18px 24px;
    margin-bottom: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    /* Menghapus margin negatif yang bikin berantakan */
    margin-top: 0;
}

/* Hiasan kecil di kiri judul */
.page-title h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 4px;
}

/* === MEMBER CARD === */
.member-card {
    background: linear-gradient(135deg, var(--accent) 0%, #26A69A 100%);
    border-radius: var(--radius);
    padding: 20px;
    color: white;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.member-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.member-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.member-top h3 {
    font-size: 18px;
    font-weight: 600;
}

.member-badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

.barcode-btn {
    background: white;
    color: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.member-points {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.point-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 14px;
    border-radius: 12px;
    flex: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.point-box:active {
    background: rgba(255, 255, 255, 0.25);
}

.point-box i {
    font-size: 20px;
}

.point-box strong {
    font-size: 13px;
    display: block;
}

.point-box small {
    font-size: 10px;
    opacity: 0.9;
}

/* === MENU GRID === */
.menu-section {
    margin-bottom: 24px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 12px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.menu-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 16px;
    /* Kotak rounded lebih modern */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s;
}

.menu-item:active .menu-icon {
    transform: scale(0.95);
}

.menu-name {
    font-size: 11px;
    color: var(--text);
    text-align: center;
    font-weight: 500;
}

/* === GENERAL SECTIONS === */
.section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.section-header a {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* === PRODUCT CARDS (CLEAN DESIGN) === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 4px;
    /* Agar shadow tidak terpotong */
}

.product-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 4px;
    padding-bottom: 16px;
}

.product-scroll::-webkit-scrollbar {
    display: none;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    padding: 12px;
    position: relative;
    box-shadow: var(--shadow-soft);
    min-width: 150px;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s;
}

.product-card:active {
    transform: scale(0.98);
}

.promo-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #FFEBEE;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
}

.prod-img {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.prod-img img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

.prod-type {
    font-size: 10px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prod-title {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    font-weight: 500;
    line-height: 1.4;
}

.prod-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: block;
}

.prod-old {
    font-size: 11px;
    color: #bbb;
    text-decoration: line-through;
    margin-left: 0;
    display: block;
    margin-top: 2px;
}

.add-btn {
    width: 100%;
    background: white;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:active,
.add-btn.added {
    background: var(--primary);
    color: white;
    transform: translateY(2px);
}

/* === OTHER COMPONENTS === */
.promo-banner img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.promo-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.promo-card {
    padding: 24px 16px;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
}

.promo-card.yellow {
    background: linear-gradient(135deg, #FFD600 0%, #FFAB00 100%);
    color: #333;
}

.promo-card.red {
    background: linear-gradient(135deg, var(--primary) 0%, #E53935 100%);
}

.brand-scroll {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0;
}

.brand-scroll::-webkit-scrollbar {
    display: none;
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 64px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #f5f5f5;
}

.brand-item span {
    font-size: 11px;
    color: var(--text-light);
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 414px;
    margin: 0 auto;
    background: white;
    border-top: 1px solid #eee;
    padding: 10px 0;
    display: flex;
    justify-content: space-around;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #aaa;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-2px);
}

/* === CART & MODAL UTILS === */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

.cart-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    max-width: 414px;
    margin: 0 auto;
    background: white;
    z-index: 1001;
    border-radius: 24px 24px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.cart-sheet.open {
    bottom: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(215, 17, 28, 0.3);
}

/* Toast & Modals */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 13px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast.active {
    opacity: 1;
}

.checkout-modal-content {
    background: white;
    border-radius: 20px;
    padding: 24px;
    width: 85%;
    max-width: 320px;
    text-align: center;
}

.checkout-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-confirm {
    background: var(--primary);
    color: white;
    border-radius: 10px;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
    border-radius: 10px;
}

/* === PAGE BACKGROUNDS (TETAP BERSIH) === */
#page-belanja,
#page-promo,
#page-pesanan {
    background: transparent;
    min-height: 100vh;
}

/* === CHECKOUT MODAL FIX === */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.checkout-overlay.active {
    opacity: 1;
}

.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    pointer-events: none;
}

.checkout-modal.show {
    pointer-events: auto;
}

.checkout-modal-content {
    background: white;
    border-radius: 24px;
    padding: 32px 24px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.checkout-modal.show .checkout-modal-content {
    transform: scale(1);
    opacity: 1;
}

.checkout-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.checkout-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    color: #666;
}

.summary-row.total {
    margin-bottom: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
}

.checkout-actions {
    display: flex;
    gap: 12px;
}

.checkout-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    font-weight: 600;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.1s;
}

.checkout-actions button:active {
    transform: scale(0.95);
}

.btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.btn-confirm {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(215, 17, 28, 0.3);
}

/* === REVAMPED ACCOUNT PAGE === */
.account-card {
    background: white;
    border-radius: 24px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

/* Background decoration for account card */
.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-orange) 100%);
    border-radius: 0 0 50% 50% / 20px;
}

.avatar {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
}

.account-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.account-card p {
    font-size: 13px;
    color: #888;
}

.account-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

.menu-list-item {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.menu-list-item:active {
    transform: scale(0.98);
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
}

.menu-left i {
    font-size: 20px;
    color: var(--primary);
    background: #FFF0F0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.menu-list-item i.ri-arrow-right-s-line {
    color: #ccc;
    font-size: 20px;
}

.menu-list-item.logout .menu-left i {
    color: #E53935;
    background: #FFEBEE;
}

.menu-list-item.logout {
    margin-top: 10px;
    border: 1px solid #FFEBEE;
}

/* === REVAMPED EMPTY STATE (PESANAN) === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 20px;
}

.empty-state i {
    font-size: 80px;
    color: #eee;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}

.empty-state button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(215, 17, 28, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}

.empty-state button:active {
    transform: scale(0.95);
}

/* === ORDER CARD (GENERATED) === */
.order-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f5f5f5;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    align-items: center;
}

.order-status {
    color: #2E7D32;
    font-weight: 700;
    background: #E8F5E9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
}