:root {
    --primary-color: #7A9139; /* Olive green from Tukangsayur.co header/buttons */
    --primary-hover: #677C2E;
    --secondary-color: #6F2B8C; /* Purple for banner */
    --bg-light: #F6F7F5; /* Very light grey/green background */
    --card-bg: #FFFFFF;
    --text-dark: #333333;
    --text-muted: #777777;
    --border-color: #E2E6E0;
    --badge-red: #E74C3C;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}
.location-dropdown {
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    background: transparent;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    /* Tambahkan padding atau style tambahan jika diperlukan */
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

body {
    background-color: #E6EADF; /* Nice soft green-grey outer background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-dark);
}

/* App frame to simulate mobile layout on desktop */
.app-frame {
    width: 100%;
    max-width: 480px; /* Mobile width */
    height: 100vh;
    max-height: 920px; /* Max height to fit screens */
    background-color: var(--bg-light);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* If screen is small, take full viewport */
@media (max-width: 480px) {
    .app-frame {
        max-width: 100%;
        height: 100vh;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Header */
.app-header {
    background-color: var(--primary-color);
    color: #FFFFFF;
    height: 60px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    position: relative;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--badge-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    border: 1.5px solid var(--primary-color);
}

/* Location Bar */
.location-bar {
    background-color: #FFFFFF;
    height: 36px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.deliver-text {
    font-weight: 400;
}

.location-name {
    color: #333333;
    font-weight: 700;
    cursor: pointer;
}

/* Main Content Area */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 70px; /* Space for bottom nav */
    scrollbar-width: none; /* Hide standard Firefox scrollbar */
}

.app-content::-webkit-scrollbar {
    display: none; /* Hide Chrome/Safari scrollbar */
}

/* Promo Banner */
.promo-banner {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    margin: 12px 16px;
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.banner-text {
    flex: 1;
    z-index: 2;
}

.banner-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.banner-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
}

/* Loading Overlay and Spinner */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(122, 145, 57, 0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.banner-image {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.banner-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

/* Category Sections */
.category-section {
    margin-bottom: 16px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background-color: #E9ECE7; /* Light greyish green background for category headers */
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4A4A4A;
    letter-spacing: 0.5px;
}

.view-all-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: #777777;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.view-all-btn:hover {
    color: var(--primary-color);
}

/* Product Cards Container (Horizontal Scroll) */
.products-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.products-scroll::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* Product Card */
.product-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 12px;
    min-width: 120px;
    width: 120px;
    flex-shrink: 0;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    scroll-snap-align: start;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.card-img-container {
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    overflow: hidden;
}

.card-img-container img, .card-img-container svg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-unit {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.product-price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    gap: 4px;
    width: 50%;
    height: 100%;
    justify-content: center;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.15rem;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Modal Overlay base */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: flex-end; /* Mobile style sliding up */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content Base */
.modal-content {
    width: 100%;
    background-color: #FFFFFF;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90%;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Product Detail Modal Content */
.detail-modal-content {
    height: 85%;
}

.detail-header-bar {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.detail-title-header {
    font-weight: 700;
    font-size: 1rem;
}

.modal-close-icon {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-dark);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close-icon:hover {
    background-color: var(--bg-light);
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.detail-img-container {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
}

.detail-img-container img, .detail-img-container svg {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
}

.detail-info {
    text-align: center;
    margin-bottom: 20px;
}

.detail-product-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.detail-product-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.detail-product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.quantity-controller {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.qty-btn:hover {
    background-color: var(--border-color);
}

.qty-number {
    font-size: 1.45rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.description-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.description-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.description-section p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #555555;
}

.detail-footer {
    padding: 16px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.btn {
    flex: 1;
    height: 48px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn:active {
    opacity: 0.9;
}

.btn-cancel {
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-add-cart {
    background-color: var(--primary-color);
    color: white;
}

.btn-add-cart:hover {
    background-color: var(--primary-hover);
}

/* Shopping Cart Modal Content */
.cart-modal-content {
    height: 80%;
}

.cart-header-bar {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.cart-header-bar h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-items-container {
    margin-bottom: 20px;
}

.cart-table-header {
    display: flex;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.col-product { flex: 2; }
.col-qty { width: 45px; text-align: center; }
.col-price { width: 75px; text-align: right; }
.col-total { width: 85px; text-align: right; }

.cart-item-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.8rem;
}

.cart-item-info {
    flex: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.cart-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.cart-thumb-svg {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-thumb-svg svg {
    max-width: 90%;
    max-height: 90%;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-dark);
}

.cart-item-category {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.cart-item-qty-container {
    width: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cart-item-qty {
    font-weight: 600;
}

.cart-item-price {
    width: 75px;
    text-align: right;
    color: var(--text-muted);
}

.cart-item-total {
    width: 85px;
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
}

/* Empty Cart View */
.empty-cart-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
}

.empty-cart-msg i {
    font-size: 3rem;
    color: var(--border-color);
}

.btn-shop-now {
    background-color: var(--primary-color);
    color: white;
    max-width: 180px;
}

/* Cart Form Section */
.grand-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1.5px solid var(--primary-color);
    border-bottom: 1.5px solid var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1rem;
}

.grand-total-val {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.cart-checkout-form {
    background-color: var(--bg-light);
    padding: 16px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #FFFFFF;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary-color);
}

.cart-footer {
    padding: 16px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-checkout {
    background-color: var(--primary-color);
    color: white;
    flex: 1.5;
}

.btn-checkout:hover {
    background-color: var(--primary-hover);
}

/* Search Screen */
.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 56px; /* Space for bottom nav */
    background-color: var(--bg-light);
    z-index: 50;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-header {
    height: 60px;
    background-color: #FFFFFF;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-inner {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

#search-input {
    width: 100%;
    height: 38px;
    padding: 0 32px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light);
    font-size: 0.85rem;
    outline: none;
}

#search-input:focus {
    border-color: var(--primary-color);
    background-color: #FFFFFF;
}

#search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
}

.search-cancel-text {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
}

.search-results-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.search-placeholder-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 16px;
}

.search-placeholder-msg i {
    font-size: 3rem;
    color: var(--border-color);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Sidebar Menu */
.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-content {
    width: 280px;
    height: 100%;
    background-color: #FFFFFF;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.sidebar-overlay.active .sidebar-content {
    transform: translateX(0);
}

.sidebar-header {
    background-color: var(--primary-color);
    color: white;
    padding: 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-links {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.sidebar-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-links li a:hover, .sidebar-links li a.active {
    background-color: var(--bg-light);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Variant Selector Premium Styling */
.variant-selector-wrapper {
    margin: 12px 16px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.variant-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variant-select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    outline: none;
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.variant-select:focus {
    border-color: var(--primary-color);
    background-color: #FFFFFF;
}

/* Product Detail Image Slider */
.detail-img-container {
    position: relative;
    width: 100%;
    height: 220px;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--bg-light);
}

.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
}

.slider-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.slide svg {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
}

/* Dots navigation */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.slider-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Arrow Navigation */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 0.85rem;
    z-index: 10;
    transition: background-color 0.2s, opacity 0.2s;
}

.slider-arrow:hover {
    background-color: #FFFFFF;
}

.slider-arrow.prev {
    left: 10px;
}

.slider-arrow.next {
    right: 10px;
}
