:root {
    --primary: #5c3c24;      /* Brown Logo */
    --primary-light: #f6eee0; /* Cream Background */
    --teal: #5c3c24;         /* Match teal buttons to brown */
    --bg-color: #f9f4ec;     /* Soft cream */
    --text-dark: #3a2517;
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Sembunyikan panah di input number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f9f4ec;
    color: var(--text-dark);
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    overflow-x: hidden;
}

/* Navbar Catalog */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 15px;
    background-color: var(--white);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.cart-icon {
    position: relative;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
}

#cart-count, #detail-cart-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 5px;
    border: 1px solid var(--white);
}

/* Hero */
.hero {
    height: 140px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('images/bouquet.png') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.hero h1 {
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 1px;
}

/* Products */
.products-section {
    padding: 10px;
    background-color: var(--bg-color);
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.card {
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.card-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content .price {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 700;
    margin-top: auto;
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-color: #121212;
    --text-dark: #e0e0e0;
    --white: #1e1e1e;
    --primary-light: #2c1a16;
}

body.dark-theme .app-container {
    background-color: var(--bg-color);
}

body.dark-theme .products-section,
body.dark-theme .cart-item,
body.dark-theme .payment-card,
body.dark-theme .how-to-order-section,
body.dark-theme .top-nav,
body.dark-theme .bottom-nav,
body.dark-theme .bottom-action-bar {
    background-color: var(--white);
    border-color: #333;
}

body.dark-theme .product-card,
body.dark-theme .category-item .cat-icon {
    background-color: #2c2c2c !important;
}

body.dark-theme hr, 
body.dark-theme .divider {
    background-color: #2a2a2a !important;
    border-color: #2a2a2a !important;
}

body.dark-theme input, 
body.dark-theme textarea,
body.dark-theme .variant-bottom-sheet {
    background-color: var(--white);
    color: var(--text-dark);
    border-color: #444;
}

body.dark-theme .sheet-header {
    border-bottom: 1px solid #333;
}

body.dark-theme .variant-chips .chip {
    background: #333;
    color: #ccc;
    border-color: #555;
}

body.dark-theme .variant-chips .chip.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

body.dark-theme .qty-btn {
    background: #333 !important;
    color: #fff;
    border-color: #444 !important;
}

body.dark-theme #sheet-qty {
    background: var(--white) !important;
    color: var(--text-dark);
}

/* Detail View */
.detail-nav {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.back-btn {
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.product-image-container {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f8f9fa;
}

body.dark-theme .product-image-container img {
    background-color: #1a1a1a;
}

.detail-section {
    padding: 15px;
    background: var(--white);
}

.detail-price {
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-title {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
    color: #222;
}

.divider {
    height: 1px;
    background-color: #eee;
    margin: 0 15px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.variant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 8px 6px;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #333;
    transition: all 0.2s;
    word-break: break-word;
    line-height: 1.2;
    text-align: center;
}

.chip.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.store-info {
    display: flex;
    align-items: center;
}

.store-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
}

.store-name {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 500;
}

.visit-store {
    padding: 6px 15px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.detail-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    white-space: pre-line;
}

/* Bottom Action Bar */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    height: 55px;
    display: flex;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 100;
}

.action-btn {
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn {
    width: 25%;
    background-color: var(--teal);
    border-right: 1px solid rgba(255,255,255,0.2);
}

.buy-btn {
    width: 50%;
    background-color: var(--primary);
    color: white;
    font-size: 1rem;
}

/* Cart Sidebar (simulating overlay on mobile) */
.cart-sidebar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(100vw);
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.cart-sidebar.open { transform: translateX(-50%); }
.cart-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s;
    z-index: 999;
}
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-header { padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.cart-header h2 { font-size: 1.2rem; }
.close-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #555; }
.cart-items { flex-grow: 1; overflow-y: auto; padding: 15px; }
.cart-item { display: flex; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; margin-right: 10px; }
.cart-item-details { flex-grow: 1; }
.cart-item-title { font-size: 0.85rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 3px;}
.cart-item-variant { font-size: 0.8rem; color: #777; margin-bottom: 5px; }
.cart-item-price { font-size: 0.9rem; color: var(--primary); font-weight: 600; }
.cart-item-qty { display: flex; align-items: center; margin-top: 5px; }
.qty-btn { background: #f5f5f5; border: 1px solid #ddd; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; }
.qty-input { width: 30px; text-align: center; border: none; font-size: 0.9rem; }
.remove-item { color: var(--primary); cursor: pointer; font-size: 0.8rem; margin-left: auto; font-weight: 500;}
.cart-footer { padding: 15px; border-top: 1px solid #eee; background: #fff; }
.cart-total { font-size: 1.1rem; font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 15px; }
.checkout-btn { width: 100%; padding: 12px; background-color: var(--primary); color: white; border: none; border-radius: 4px; font-size: 1rem; font-weight: 500; cursor: pointer; }

/* Payment View */
.payment-container {
    padding: 15px;
    background-color: var(--bg-color);
    min-height: calc(100vh - 60px);
}

.payment-card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
}

.payment-card h3 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
}

.payment-total {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
}

.qris-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-subtitle {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 15px;
    line-height: 1.4;
}

.qris-image {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

.payment-note {
    font-size: 0.75rem;
    color: #aaa;
    font-style: italic;
}

.bank-details {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.bank-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.bank-acc {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 1px;
    margin: 5px 0;
}

.bank-owner {
    font-size: 0.9rem;
    color: #666;
}

.confirm-payment-btn {
    background-color: #25D366; /* WA Green */
    margin-top: 10px;
    font-size: 1.1rem;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

/* ================= LIGHT THEME (GROSERA) ================= */
.light-theme {
    background-color: #fbfbfb;
    color: #333;
    min-height: 100vh;
    padding-bottom: 70px; /* space for bottom nav */
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}
.header-actions {
    display: flex;
    gap: 15px;
}
.cart-icon {
    position: relative;
    cursor: pointer;
}

/* Hero Banner */
.hero-banner {
    margin: 15px;
    height: 180px;
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('images/bouquet.png') center/cover;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 20px;
    color: white;
}
.hero-content h2 {
    font-size: 1.2rem;
    line-height: 1.3;
    margin-bottom: 5px;
}
.hero-content p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}
.btn-shop {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

/* Categories Row */
.categories-row {
    display: flex;
    justify-content: space-between;
    padding: 0 15px 20px;
    text-align: center;
}
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 23%;
}
.cat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.category-item span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #444;
}

/* Services */
.services-row {
    display: flex;
    gap: 15px;
    padding: 0 15px 15px;
    overflow-x: auto;
}
.services-row::-webkit-scrollbar { display: none; }
.service-card {
    flex: 0 0 85%;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.service-icon {
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.service-info h4 { font-size: 0.9rem; margin-bottom: 3px; }
.service-info p { font-size: 0.75rem; color: #666; margin-bottom: 5px; }
.service-info span { font-size: 0.85rem; font-weight: 600; color: #2e7d32; }

/* Product List specific tweaks */
.light-theme .products-section {
    background: transparent;
}
.light-theme .card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #eee;
    border-radius: 8px;
}
.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #888;
    cursor: pointer;
    font-size: 0.7rem;
    gap: 4px;
}
.nav-item.active {
    color: #4caf50;
}

/* Variant Bottom Sheet */
.variant-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.variant-sheet-overlay.show {
    opacity: 1;
    visibility: visible;
}
.variant-bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    z-index: 1001;
    padding: 20px 15px 15px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}
.variant-bottom-sheet.show {
    bottom: 0;
}
.sheet-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}
.sheet-img {
    width: 240px;
    height: 240px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.sheet-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ee4d2d;
    margin-top: 10px;
}
.sheet-stock {
    font-size: 0.8rem;
    color: #666;
}
.close-sheet-btn {
    position: absolute;
    top: -5px;
    right: 0;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.sheet-body {
    overflow-y: auto;
    padding-bottom: 15px;
}
.sheet-footer {
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.confirm-cart-btn {
    width: 100%;
    background: #ee4d2d;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

 / *   D a r k   T h e m e   V a r i a b l e s   * / 
 b o d y . d a r k - t h e m e   { 
         - - b g - c o l o r :   # 1 2 1 2 1 2 ; 
         - - t e x t - d a r k :   # e 0 e 0 e 0 ; 
         - - w h i t e :   # 1 e 1 e 1 e ; 
         - - p r i m a r y - l i g h t :   # 2 c 1 a 1 6 ; 
 } 
 
 b o d y . d a r k - t h e m e   . a p p - c o n t a i n e r   { 
         b a c k g r o u n d - c o l o r :   v a r ( - - b g - c o l o r ) ; 
 } 
 
 b o d y . d a r k - t h e m e   . p r o d u c t s - s e c t i o n , 
 b o d y . d a r k - t h e m e   . c a r t - i t e m , 
 b o d y . d a r k - t h e m e   . p a y m e n t - c a r d , 
 b o d y . d a r k - t h e m e   . h o w - t o - o r d e r - s e c t i o n , 
 b o d y . d a r k - t h e m e   . t o p - n a v , 
 b o d y . d a r k - t h e m e   . b o t t o m - n a v , 
 b o d y . d a r k - t h e m e   . b o t t o m - a c t i o n - b a r   { 
         b a c k g r o u n d - c o l o r :   v a r ( - - w h i t e ) ; 
         b o r d e r - c o l o r :   # 3 3 3 ; 
 } 
 
 b o d y . d a r k - t h e m e   . p r o d u c t - c a r d , 
 b o d y . d a r k - t h e m e   . c a t e g o r y - i t e m   . c a t - i c o n   { 
         b a c k g r o u n d - c o l o r :   # 2 c 2 c 2 c   ! i m p o r t a n t ; 
 } 
 
 b o d y . d a r k - t h e m e   h r ,   
 b o d y . d a r k - t h e m e   . d i v i d e r   { 
         b a c k g r o u n d - c o l o r :   # 2 a 2 a 2 a   ! i m p o r t a n t ; 
         b o r d e r - c o l o r :   # 2 a 2 a 2 a   ! i m p o r t a n t ; 
 } 
 
 b o d y . d a r k - t h e m e   i n p u t ,   
 b o d y . d a r k - t h e m e   t e x t a r e a , 
 b o d y . d a r k - t h e m e   . v a r i a n t - b o t t o m - s h e e t   { 
         b a c k g r o u n d - c o l o r :   v a r ( - - w h i t e ) ; 
         c o l o r :   v a r ( - - t e x t - d a r k ) ; 
         b o r d e r - c o l o r :   # 4 4 4 ; 
 } 
 
 b o d y . d a r k - t h e m e   . s h e e t - h e a d e r   { 
         b o r d e r - b o t t o m :   1 p x   s o l i d   # 3 3 3 ; 
 } 
 
 b o d y . d a r k - t h e m e   . v a r i a n t - c h i p s   . c h i p   { 
         b a c k g r o u n d :   # 3 3 3 ; 
         c o l o r :   # c c c ; 
         b o r d e r - c o l o r :   # 5 5 5 ; 
 } 
 
 b o d y . d a r k - t h e m e   . v a r i a n t - c h i p s   . c h i p . a c t i v e   { 
         b a c k g r o u n d :   v a r ( - - p r i m a r y - l i g h t ) ; 
         c o l o r :   v a r ( - - p r i m a r y ) ; 
         b o r d e r - c o l o r :   v a r ( - - p r i m a r y ) ; 
 } 
 
 b o d y . d a r k - t h e m e   . q t y - b t n   { 
         b a c k g r o u n d :   # 3 3 3   ! i m p o r t a n t ; 
         c o l o r :   # f f f ; 
         b o r d e r - c o l o r :   # 4 4 4   ! i m p o r t a n t ; 
 } 
 
 b o d y . d a r k - t h e m e   # s h e e t - q t y   { 
         b a c k g r o u n d :   v a r ( - - w h i t e )   ! i m p o r t a n t ; 
         c o l o r :   v a r ( - - t e x t - d a r k ) ; 
 } 
  
 
.option-box {
    border: 2px solid #ddd;
    background: white;
    color: #333;
    transition: 0.2s;
}
body.dark-theme .option-box {
    border-color: #555;
    background: #2a2a2a;
    color: #e0e0e0;
}
.option-box.active {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: #ffffff !important;
}
