/* ==========================================================================
   ARTISAN BREW & SLICE - DESIGN SYSTEM & STYLESHEET
   Theme: Warm Dark Espresso, Caramel Amber, Mozzarella Gold
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #120d0a;
    --bg-card: #1c1511;
    --bg-card-hover: #261e18;
    --bg-glass: rgba(28, 21, 17, 0.85);
    
    --primary: #e58e26;
    --primary-hover: #f59e0b;
    --primary-glow: rgba(229, 142, 38, 0.35);
    
    --accent-red: #eb4d4b;
    --accent-green: #2ed573;
    --accent-gold: #ffbe76;
    --accent-blue: #0984e3;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(229, 142, 38, 0.3);

    /* Fonts */
    --font-km: 'Kantumruy Pro', 'Outfit', sans-serif;
    --font-en: 'Outfit', 'Kantumruy Pro', sans-serif;
    
    /* Transitions & Shadows */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body.dark-theme {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-km);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #33271e;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-km);
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #d35400);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: rgba(235, 77, 75, 0.2);
    border: 1px solid var(--accent-red);
    color: #ff7675;
}
.btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ==========================================================================
   NAVBAR & HEADER
   ========================================================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.brand-icon {
    position: relative;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #b33939);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-overlay-icon {
    position: absolute;
    bottom: -2px;
    right: -4px;
    font-size: 0.75rem;
    color: #ffda79;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.brand-title {
    font-family: var(--font-en);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    line-height: 1.1;
}

.brand-title .accent-text {
    color: var(--primary);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Search Box */
.search-box {
    position: relative;
    width: 250px;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-km);
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

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

.clear-search {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.kds-toggle-btn {
    border-color: var(--border-highlight);
    color: var(--accent-gold);
}

.owner-btn {
    border-color: rgba(255, 190, 118, 0.4);
    color: var(--accent-gold);
    background: rgba(255, 190, 118, 0.1);
}

.owner-btn:hover {
    background: rgba(255, 190, 118, 0.25);
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(255, 190, 118, 0.3);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(235, 77, 75, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(235, 77, 75, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(235, 77, 75, 0); }
}

/* Cart Nav Button */
.cart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #d35400);
    border: none;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: var(--transition-fast);
}

.cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--primary-glow);
}

.cart-count-badge {
    background: #fff;
    color: #d35400;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.hero-banner {
    position: relative;
    background: linear-gradient(rgba(18, 13, 10, 0.65), rgba(18, 13, 10, 0.95)), 
                url('https://images.unsplash.com/photo-1509042239860-f550ce710b93?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
    padding: 4rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    max-width: 750px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(235, 77, 75, 0.2);
    border: 1px solid rgba(235, 77, 75, 0.4);
    color: #ff7675;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #ffffff, #ffda79);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.8rem;
}

.highlight-code {
    background: rgba(229, 142, 38, 0.2);
    color: var(--primary);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    border: 1px dashed var(--primary);
    font-family: var(--font-en);
    font-weight: 700;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ==========================================================================
   MAIN MENU & CATEGORY TABS
   ========================================================================== */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.category-nav {
    margin-bottom: 2rem;
}

.category-tabs {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.cat-tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.8rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-km);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.cat-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.cat-tab.active {
    background: linear-gradient(135deg, var(--primary), #d35400);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.custom-select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-km);
    outline: none;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Product Card Component */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-highlight);
    box-shadow: var(--shadow-lg), 0 0 15px var(--primary-glow);
}

.product-card.out-of-stock {
    opacity: 0.6;
    filter: grayscale(0.4);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #251b14;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img {
    transform: scale(1.08);
}

.item-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 190, 118, 0.3);
}

.out-stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #eb4d4b;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
}

.rating-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    color: #ffbe76;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.price-box {
    display: flex;
    flex-direction: column;
}

.price-usd {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-en);
}

.price-khr {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.add-btn {
    background: rgba(229, 142, 38, 0.15);
    color: var(--primary);
    border: 1px solid rgba(229, 142, 38, 0.4);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.add-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.05);
}

.add-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.no-results-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   MODAL WINDOWS (General Backdrop & Base Modal)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* ==========================================================================
   PRODUCT CUSTOMIZATION MODAL
   ========================================================================== */
.custom-modal {
    max-width: 800px;
    padding: 0;
    overflow: hidden;
}

.custom-modal-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
}

.custom-img-container {
    position: relative;
    height: 100%;
    min-height: 300px;
    background: #251b14;
}

.custom-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.8);
    color: var(--accent-gold);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.custom-details {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow-y: auto;
}

.custom-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.custom-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.custom-price-tag {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-en);
    margin-bottom: 1.5rem;
}

.option-block {
    margin-bottom: 1.4rem;
}

.option-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip-option {
    cursor: pointer;
}

.chip-option input {
    display: none;
}

.chip-option span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.chip-option input:checked + span {
    background: rgba(229, 142, 38, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.option-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.custom-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-km);
    font-size: 0.9rem;
}

.custom-input:focus {
    outline: none;
    border-color: var(--primary);
}

.custom-action-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.2rem;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.qty-val {
    width: 32px;
    text-align: center;
    font-weight: 800;
    font-family: var(--font-en);
    font-size: 1rem;
}

.add-to-cart-submit {
    flex-grow: 1;
}

/* ==========================================================================
   CART SLIDING DRAWER
   ========================================================================== */
.cart-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 300;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-highlight);
    box-shadow: -10px 0 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    animation: drawerSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawerSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

.cart-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

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

/* Dining Mode */
.dining-selector {
    display: flex;
    padding: 0.8rem 1.5rem 0.4rem;
    gap: 0.5rem;
}

.dining-option {
    flex: 1;
    cursor: pointer;
}

.dining-option input {
    display: none;
}

.dining-option span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    transition: var(--transition-fast);
}

.dining-option input:checked + span {
    background: rgba(229, 142, 38, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.table-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.4rem 1.5rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.8rem;
    color: var(--text-secondary);
}

.table-input-wrapper input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-km);
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

/* Cart Items Container */
.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    position: relative;
}

.cart-item-img {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cart-item-opts {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-en);
    font-size: 0.95rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
}

.cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
}

.cart-item-remove:hover {
    color: var(--accent-red);
}

.empty-cart-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-cart-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Promo section */
.promo-section {
    padding: 0.8rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.promo-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.promo-icon {
    color: var(--accent-gold);
}

.promo-input-group input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.8rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-en);
    text-transform: uppercase;
}

.promo-msg {
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.promo-msg.success {
    color: var(--accent-green);
}
.promo-msg.error {
    color: var(--accent-red);
}

/* Cart Footer */
.cart-footer {
    padding: 1.2rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid var(--border-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.discount-line {
    color: var(--accent-green);
}

.total-line {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-color);
}

.total-price-group {
    text-align: right;
}

.total-usd {
    display: block;
    color: var(--primary);
    font-family: var(--font-en);
    font-size: 1.4rem;
}

.total-khr {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: normal;
}

.checkout-btn {
    width: 100%;
    margin-top: 1rem;
}

/* ==========================================================================
   CHECKOUT & KHQR MODAL
   ========================================================================== */
.checkout-modal {
    max-width: 500px;
    padding: 1.8rem;
}

.checkout-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.checkout-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.checkout-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.payment-tabs {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.payment-tab {
    flex: 1;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-km);
}

.payment-tab.active {
    background: rgba(229, 142, 38, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.khqr-card {
    background: #e74c3c;
    border-radius: var(--radius-md);
    padding: 1.2rem;
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.khqr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 800;
    font-family: var(--font-en);
}

.khqr-logo {
    background: #fff;
    color: #e74c3c;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.khqr-qr-box {
    position: relative;
    background: #fff;
    padding: 1rem;
    border-radius: var(--radius-sm);
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-generated svg, .qr-code-generated canvas {
    width: 100%;
    height: 100%;
}

.qr-center-logo {
    position: absolute;
    background: #e74c3c;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.khqr-amount-display {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-en);
}

.khqr-instruction {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.cash-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem 1rem;
    text-align: center;
}

.cash-icon {
    font-size: 2.5rem;
    color: var(--accent-green);
    margin-bottom: 0.8rem;
}

.checkout-customer-form {
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.input-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.input-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-km);
}

.checkout-action-footer {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.checkout-action-footer .btn {
    flex: 1;
}

/* ==========================================================================
   ORDER STATUS TRACKER MODAL
   ========================================================================== */
.tracker-modal {
    max-width: 600px;
    padding: 2rem;
}

.tracker-header {
    text-align: center;
    margin-bottom: 2rem;
}

.order-id-badge {
    display: inline-block;
    background: rgba(229, 142, 38, 0.2);
    color: var(--primary);
    font-family: var(--font-en);
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
}

.order-time-stamp {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tracker-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 1rem;
    z-index: 2;
}

.tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 22%;
    text-align: center;
    opacity: 0.4;
    transition: var(--transition-smooth);
}

.tracker-step.active {
    opacity: 1;
}

.step-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.tracker-step.active .step-icon {
    background: linear-gradient(135deg, var(--primary), #d35400);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
}

.tracker-progress-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin: -2.3rem 2rem 2rem;
    position: relative;
    z-index: 1;
}

.tracker-progress-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, var(--primary), var(--accent-green));
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
}

.tracker-status-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.status-anim-icon {
    font-size: 2rem;
    color: var(--primary);
}

.status-info h3 {
    font-size: 1rem;
    color: var(--text-primary);
}

.status-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-receipt-summary {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    max-height: 150px;
    overflow-y: auto;
}

.receipt-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.tracker-footer {
    display: flex;
    gap: 0.8rem;
}

.tracker-footer .btn {
    flex: 1;
}

/* ==========================================================================
   KITCHEN DISPLAY SYSTEM (KDS) MODAL
   ========================================================================== */
.kds-modal {
    max-width: 1000px;
    padding: 1.8rem;
}

.kds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.kds-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.kds-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.kds-card-header {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.kds-order-items {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.kds-item-line {
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.kds-status-btn {
    width: 100%;
}

/* ==========================================================================
   STORE OWNER PIN & DASHBOARD MODALS
   ========================================================================== */
.pin-modal {
    max-width: 380px;
    padding: 2rem;
    text-align: center;
}

.pin-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 190, 118, 0.15);
    color: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
    border: 1px solid rgba(255, 190, 118, 0.4);
}

.pin-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.pin-header p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.pin-input-group {
    margin-bottom: 1.2rem;
}

.pin-input-group input {
    width: 160px;
    height: 48px;
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: 12px;
    font-weight: 800;
    font-family: var(--font-en);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--border-highlight);
    border-radius: var(--radius-md);
    color: var(--primary);
    outline: none;
}

.pin-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

.pin-error {
    color: var(--accent-red);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.pin-footer {
    display: flex;
    gap: 0.8rem;
}

.pin-footer .btn {
    flex: 1;
}

/* OWNER DASHBOARD MODAL STYLES */
.owner-dashboard-modal {
    max-width: 1100px;
    padding: 1.8rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.owner-tabs {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.owner-tab {
    padding: 0.7rem 1.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-km);
    transition: var(--transition-fast);
}

.owner-tab.active {
    background: linear-gradient(135deg, var(--primary), #d35400);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Stats Cards Grid */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.icon-green { background: rgba(46, 213, 115, 0.15); color: var(--accent-green); }
.icon-orange { background: rgba(229, 142, 38, 0.15); color: var(--primary); }
.icon-gold { background: rgba(255, 190, 118, 0.15); color: var(--accent-gold); }
.icon-blue { background: rgba(9, 132, 227, 0.15); color: var(--accent-blue); }

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-en);
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Owner Table */
.owner-table-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    overflow-x: auto;
}

.table-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.owner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.owner-table th {
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.owner-table td {
    padding: 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* MENU CRUD GRID */
.menu-crud-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.crud-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.crud-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.crud-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.crud-card-img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.crud-card-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.crud-card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-en);
}

.crud-card-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stock-toggle-btn {
    flex: 1;
}

/* ITEM EDITOR FORM MODAL */
.item-editor-modal {
    max-width: 650px;
    padding: 2rem;
}

.item-editor-modal h2 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.preset-images-box {
    margin: 0.8rem 0 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem;
    border-radius: var(--radius-md);
}

.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.preset-chip {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    cursor: pointer;
}

.preset-chip:hover {
    background: rgba(229, 142, 38, 0.2);
    color: var(--primary);
}

.editor-action-footer {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}

.editor-action-footer .btn {
    flex: 1;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-notification {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 13, 10, 0.95);
    border: 1px solid var(--primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.8), 0 0 15px var(--primary-glow);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    z-index: 400;
    color: #fff;
    font-size: 0.9rem;
    animation: toastBounce 0.3s ease;
}

@keyframes toastBounce {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.toast-icon {
    color: var(--accent-green);
    font-size: 1.1rem;
}

/* ==========================================================================
   PRINTABLE RECEIPT STYLES
   ========================================================================== */
@media print {
    body * {
        visibility: hidden;
    }
    .tracker-modal, .tracker-modal * {
        visibility: visible;
    }
    .tracker-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000;
        background: #fff;
    }
    .tracker-footer, .tracker-steps, .tracker-progress-bg {
        display: none !important;
    }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }
    .search-box {
        width: 100%;
        order: 3;
    }
    .custom-modal-grid {
        grid-template-columns: 1fr;
    }
    .custom-img-container {
        height: 200px;
    }
    .hero-title {
        font-size: 1.6rem;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}
