:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --primary: #1e3a8a;
    --primary-light: #eff6ff;
    --border-color: #e5e7eb;
    --input-bg: #ffffff;
    --nav-bg: #f3f4f6;
    --success: #059669;
    --cart-bg: #f9fafb;
    --payment-box-bg: #fff;
    --bottom-nav-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-color: #111827;
    --card-bg: #1f2937;
    --text-color: #f9fafb;
    --text-muted: #9ca3af;
    --primary: #3b82f6;
    --primary-light: #374151;
    --border-color: #374151;
    --input-bg: #111827;
    --nav-bg: #111827;
    --success: #34d399;
    --cart-bg: #111827;
    --payment-box-bg: #1f2937;
    --bottom-nav-bg: #1f2937;
}

* {
    margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    background-color: var(--bg-color); color: var(--text-color);
    min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    padding-bottom: 80px;
}

.top-action-bar {
    position: absolute; top: 15px; width: 100%; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center; z-index: 20;
}

.active-users {
    background: rgba(0, 0, 0, 0.4); color: white; padding: 5px 12px;
    border-radius: 20px; font-size: 0.8rem; display: flex; align-items: center; gap: 6px;
    backdrop-filter: blur(5px);
}

.pulse-dot {
    width: 8px; height: 8px; background: #34d399; border-radius: 50%;
    box-shadow: 0 0 8px #34d399; animation: pulse 1.5s infinite;
}
@keyframes pulse { 0% {opacity: 1;} 50% {opacity: 0.4;} 100% {opacity: 1;} }

.theme-toggle {
    background: rgba(255, 255, 255, 0.2); border: none; font-size: 1.2rem;
    cursor: pointer; padding: 6px 10px; border-radius: 50%; backdrop-filter: blur(5px);
}

.hero-bg {
    width: 100%; height: 260px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    position: relative; padding: 60px 20px 20px; text-align: center; color: #ffffff;
}

.hero-points {
    display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
}
.point-badge {
    background: rgba(255, 255, 255, 0.15); padding: 4px 10px;
    border-radius: 12px; font-size: 0.8rem; font-weight: 500;
}

.cart-fab {
    position: fixed; bottom: 85px; right: 20px;
    background: var(--card-bg); color: var(--text-color);
    border: 2px solid var(--primary); padding: 12px 18px; border-radius: 25px;
    font-weight: 600; font-size: 1rem; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); z-index: 100;
    display: flex; align-items: center; gap: 8px;
}
.badge { background: #ef4444; color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; }

.main-container {
    width: 95%; max-width: 850px; background: var(--card-bg);
    border-radius: 24px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    margin-top: -40px; padding: 24px; position: relative; z-index: 10; margin-bottom: 20px;
}

.brand-title { font-size: 1.5rem; color: var(--primary); text-align: center; font-weight: 600; }
.subtitle { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-bottom: 20px; }

.category-nav {
    display: flex; gap: 8px; background: var(--nav-bg); padding: 6px; border-radius: 14px; margin-bottom: 24px;
}
.nav-btn {
    flex: 1; background: transparent; border: none; padding: 10px 6px;
    color: var(--text-muted); border-radius: 10px; cursor: pointer; font-weight: 500;
}
.nav-btn.active { background: var(--card-bg); color: var(--primary); font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.tab-content { display: none; }
.tab-content.active { display: block; }
.mt-15 { margin-top: 15px; }

/* Product Cards & Option Selectors */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.product-card { 
    display: flex; flex-direction: column; border: 1px solid var(--border-color); 
    border-radius: 16px; padding: 14px; background: var(--card-bg);
}
.product-top-row { display: flex; align-items: center; width: 100%; }
.product-img { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; margin-right: 14px; }
.product-info { flex: 1; }
.product-name { font-size: 0.95rem; font-weight: 600; color: var(--text-color); }
.product-price { font-size: 0.85rem; color: var(--success); font-weight: 600; margin-top: 2px; }
.offline-rate { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }

.product-option-select {
    width: 100%; margin-top: 10px; padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--border-color); background: var(--input-bg);
    color: var(--text-color); font-size: 0.85rem; outline: none;
}

.quantity-controls { display: flex; align-items: center; gap: 10px; }
.qty-btn {
    width: 30px; height: 30px; border: 1px solid var(--border-color);
    background: var(--input-bg); color: var(--text-color); border-radius: 50%; 
    cursor: pointer; font-weight: 600; font-size: 1.1rem;
}
.qty-number { font-size: 0.95rem; font-weight: 600; width: 20px; text-align: center; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-color); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 10px;
    background: var(--input-bg); color: var(--text-color); outline: none; font-size: 0.9rem;
}
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-group-row { flex-direction: row; }
.radio-label {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--cart-bg); padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); flex: 1;
}

.price-estimator { background: var(--primary-light); padding: 12px; border-radius: 10px; color: var(--primary); text-align: center; margin-bottom: 14px; font-weight: 600; }
.btn-primary, .btn-checkout { width: 100%; padding: 14px; border-radius: 12px; font-weight: 600; cursor: pointer; border: none; color: #fff; font-size: 0.95rem; }
.btn-primary { background: var(--primary); }
.btn-checkout { background: #25d366; margin-top: 15px; }
.btn-back { background: none; border: none; color: var(--text-muted); margin-bottom: 15px; cursor: pointer; font-weight: 600; font-size: 0.9rem; }

/* Cart & Payment UI */
.cart-items-list { background: var(--cart-bg); border-radius: 12px; padding: 14px; border: 1px solid var(--border-color); }
.cart-item-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.remove-item-btn { color: #ef4444; background: none; border: none; font-weight: bold; cursor: pointer; margin-left: 8px; }
.cart-summary-box { margin-top: 12px; padding: 14px; background: var(--primary-light); border-radius: 10px; border: 1px solid var(--border-color); }
.summary-line { display: flex; justify-content: space-between; font-weight: 600; color: var(--primary); }
.payment-box { background: var(--payment-box-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 16px; }
.qr-title { text-align: center; color: var(--primary); margin-bottom: 8px; }
.qr-container { display: flex; flex-direction: column; align-items: center; margin: 20px 0; }
.mock-qr { width: 160px; background: white; border: 2px solid #374151; border-radius: 12px; padding: 12px; text-align: center; }
.qr-code-square { width: 132px; height: 132px; background: #374151; margin: 0 auto 8px auto; }

/* Feedback Section */
.feedback-card { background: var(--cart-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 18px; }
.social-links-box { margin-top: 24px; text-align: center; border-top: 1px dashed var(--border-color); padding-top: 16px; }
.social-links-box p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.social-btn-row { display: flex; flex-direction: column; gap: 10px; }
.social-btn { display: block; padding: 10px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.wa-link { background: #dcf8c6; color: #075e54; }
.insta-link { background: #fce7f3; color: #9d174d; }

/* Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 1000; justify-content: center; align-items: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    background: var(--card-bg); color: var(--text-color); padding: 24px; border-radius: 20px;
    text-align: center; width: 85%; max-width: 380px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.countdown-circle {
    width: 50px; height: 50px; border-radius: 50%; background: var(--primary-light);
    color: var(--primary); font-size: 1.3rem; font-weight: bold;
    display: flex; justify-content: center; align-items: center; margin: 16px auto;
}

/* Footer & Bottom Nav */
.app-footer-note { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: auto; padding: 10px 0 20px; }
.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; background: var(--bottom-nav-bg);
    display: flex; justify-content: space-around; padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 50; border-top: 1px solid var(--border-color);
}
.bottom-nav-item {
    background: transparent; border: none; display: flex; flex-direction: column;
    align-items: center; color: var(--text-muted); cursor: pointer; gap: 4px; font-family: 'Poppins', sans-serif;
}
.bottom-nav-item.active { color: var(--primary); font-weight: 600; }
.bottom-nav-item span { font-size: 1.2rem; }

@media(min-width: 650px) {
    .product-grid { grid-template-columns: 1fr 1fr; }
    .radio-group { flex-direction: row; }
    .mobile-bottom-nav { display: none; }
    body { padding-bottom: 20px; }
    .cart-fab { bottom: 30px; }
    .social-btn-row { flex-direction: row; justify-content: center; }
}
/* Scrolling Banner Styles */
.scrolling-banner {
    width: 100%;
    background: linear-gradient(to right, #a90000f9, #d68000ce);/* Default Red for closed/loading */
    color: white;
    padding: 8px 0;
    overflow: hidden;
    position: relative;
    z-index: 50;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.3s;
}
.scrolling-banner.open {
    background-color: #059669; /* Green when open */
}
.scrolling-text {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left 25s linear infinite;
    padding-left: 100%; /* Start off-screen right */
}
@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Adjust top action bar since banner is above it */
.top-action-bar {
    position: absolute; top: 45px; width: 100%; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center; z-index: 20;
}
.hero-bg {
    padding: 70px 20px 20px; /* added top padding to push content down */
}

/* Custom QR Image Styles */
.custom-qr-wrapper {
    width: 200px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.custom-qr-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}