@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #2b7a4b; /* Hijau daun/pepohonan */
    --primary-dark: #1e5c36; /* Hijau gelap */
    --background: #f1f7f3; /* Putih kehijauan sangat terang */
    --surface: #ffffff;
    --text-main: #1b2e21; /* Hitam kehijauan */
    --text-muted: #647a6a; /* Abu-abu kehijauan */
    --border: #d1e3d6; /* Border hijau pucat */
    --success: #10b981;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.cart-sidebar {
    width: 400px;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 15px rgba(0,0,0,0.02);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.datetime {
    color: var(--text-muted);
    font-size: 14px;
}

/* Category Tabs */
.category-tabs-container {
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 10;
    padding-bottom: 12px;
}
.category-tabs {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.category-tabs::-webkit-scrollbar {
    height: 6px;
}
.category-tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}
.cat-btn {
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(43, 122, 75, 0.1);
}
.cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(43, 122, 75, 0.2);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding-bottom: 24px;
}

.product-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    border-color: var(--primary);
}

.product-icon {
    width: 80px;
    height: 80px;
    background: #e6f0e9; /* Latar icon kehijauan */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--primary);
}

.product-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

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

/* Cart Sidebar */
.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.cart-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.item-price {
    font-size: 14px;
    color: var(--text-muted);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: #e6f0e9;
}

.item-qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 16px;
}

.summary-row.total {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

.btn-checkout:disabled {
    background: var(--border);
    cursor: not-allowed;
}

.empty-cart {
    text-align: center;
    color: var(--text-muted);
    margin-top: 40px;
}

/* Modal / Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loader-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Variant Modal */
.variant-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.variant-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface);
    padding: 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(20px);
    transition: transform 0.2s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.variant-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.variant-choice-btn {
    padding: 12px;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary-dark);
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-choice-btn:hover {
    background: var(--primary);
    color: white;
}

.quick-money-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.quick-money-btn:hover {
    background: #e6f0e9;
    border-color: var(--primary);
    color: var(--primary-dark);
}
