/* File: frontend/assets/css/customer.css */

:root {
    /* Color Palette - Shopee Inspired */
    --primary: #EE4D2D;
    --primary-hover: #F06236;
    --primary-light: rgba(238, 77, 45, 0.1);
    --secondary: #FF7337;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    
    /* Text Colors */
    --text-main: #333333;
    --text-muted: #757575;
    --text-light: #999999;
    
    /* Status Colors */
    --success: #26AA99;
    --warning: #FFB536;
    --danger: #EE4D2D;
    --info: #2563EB;
    
    /* Borders & Shadows */
    --border-color: #EAEAEA;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

/* Global Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    /* Prevent pull-to-refresh on mobile if standalone */
    overscroll-behavior-y: none;
}

/* Mobile App Wrapper */
.customer-app {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--background);
    min-height: 100vh;
    position: relative;
    padding-bottom: calc(80px + env(safe-area-inset-bottom)); /* Space for bottom cart bar */
    box-shadow: var(--shadow-md);
}

/* Header */
.customer-header {
    background-color: var(--surface);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.customer-header .brand {
    display: flex;
    flex-direction: column;
}

.customer-header .brand-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.customer-header .saung-info {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.customer-header .btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 50%;
}

.customer-header .btn-back:active {
    background-color: var(--background);
}

/* Category Scroller (Horizontal) */
.category-scroller {
    background-color: var(--surface);
    padding: 12px 16px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    border-bottom: 1px solid var(--border-color);
}

.category-scroller::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-btn {
    white-space: nowrap;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--surface);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.category-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.menu-card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid transparent;
}

.menu-card.unavailable {
    opacity: 0.6;
    filter: grayscale(100%);
    pointer-events: none;
}

.menu-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #EAEAEA;
}

.menu-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.menu-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.menu-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    margin-bottom: 12px;
}

/* Quantity Control (Touch First) */
.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--background);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 36px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: transparent;
    color: var(--text-main);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qty-btn:active {
    background-color: #E0E0E0;
}

.qty-btn.add {
    color: var(--primary);
}

.qty-input {
    width: 40px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background-color: transparent;
    color: var(--text-main);
    pointer-events: none; /* Prevent keyboard popup on mobile */
}

/* Add to Cart Button (Card Level) */
.btn-add-cart {
    width: 100%;
    height: 36px;
    border: 1px solid var(--primary);
    background-color: var(--surface);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-cart:active {
    background-color: var(--primary-light);
}

/* Floating Bottom Bar (Cart Summary) */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background-color: var(--surface);
    box-shadow: var(--shadow-float);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.cart-summary {
    display: flex;
    flex-direction: column;
}

.cart-summary .total-label {
    font-size: 12px;
    color: var(--text-muted);
}

.cart-summary .total-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.btn-checkout {
    background-color: var(--primary);
    color: var(--surface);
    border: none;
    border-radius: var(--radius-md);
    padding: 0 24px;
    height: 44px; /* Touch target size */
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-checkout:active {
    background-color: var(--primary-hover);
}

.btn-checkout .badge {
    background-color: var(--surface);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Cart List Page Specifics */
.cart-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    gap: 12px;
    background-color: var(--surface);
    padding: 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.cart-item-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--background);
}

.cart-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.cart-item-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.cart-item-price {
    font-weight: 600;
    color: var(--primary);
}

/* Input Note Dapur */
.input-note {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    margin-top: 12px;
    resize: none;
}

.input-note:focus {
    outline: none;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.empty-state svg {
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Status Tracking Elements */
.status-timeline {
    padding: 24px 16px;
    background-color: var(--surface);
    margin-top: 12px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    z-index: 2;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 32px;
    left: 15px;
    width: 2px;
    height: calc(100% - 32px);
    background-color: var(--border-color);
    z-index: 1;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-item.active .timeline-icon {
    background-color: var(--primary-light);
    color: var(--primary);
}

.timeline-item.active::after {
    background-color: var(--primary);
}

.timeline-item.done .timeline-icon {
    background-color: var(--primary);
    color: var(--surface);
}

.timeline-item.done::after {
    background-color: var(--primary);
}

.timeline-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text-main);
}

.timeline-content p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* General Buttons */
.btn {
    min-height: 44px; /* Touch friendly */
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    padding: 0 16px;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--surface);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* Toasts / Notifications */
#toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: #333333;
    color: #FFFFFF;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* =========================================================================
   TAMBAHAN BARU: STATUS PESANAN (Lacak Pesanan) SPECIFIC STYLES
   ========================================================================= */

/* Container Utama Kartu Pesanan */
.order-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Header Kartu (ID Pesanan & Status Utama) */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background-color: #fafafa;
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    font-family: 'Montserrat', sans-serif;
}

.order-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Badge Status Utama */
.badge-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status.status-proses {
    background-color: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEEBA;
}

.badge-status.status-selesai {
    background-color: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.badge-status.status-batal {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* Area Daftar Item Makanan */
.order-items {
    padding: 8px 16px;
}

.item-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    align-items: center;
}

.item-row:last-child {
    border-bottom: none;
}

.item-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--border-color);
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 2px 0;
}

.item-note {
    font-size: 11px;
    color: var(--primary);
    font-style: italic;
    margin-bottom: 4px;
}

/* Status Dapur per Item */
.item-status-dapur {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--warning);
    margin-top: 2px;
}

.item-status-dapur.selesai {
    color: var(--success);
}

.item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

/* Footer Kartu (Total Harga) */
.order-footer {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: #fafafa;
    border-top: 1px solid var(--border-color);
}

.order-total-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.order-total-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Montserrat', sans-serif;
}

/* Animasi Spin Tombol Refresh */
.spin {
    animation: spin-anim 1s linear infinite;
}
@keyframes spin-anim {
    100% { transform: rotate(360deg); }
}