/* ==========================================================================
   1. CORE THEME CONFIGURATIONS (DARK LOGIC & LIGHT OVERRIDES)
   ========================================================================== */
:root {
    /* DEFAULT DARK PALETTE VALUES */
    --bg-darkest: #0b0f14;
    --bg-surface: #121822;
    --bg-component: #1a2332;
    --bg-interactive: #222f42;
    --border-subtle: #202b3c;
    
    --text-primary: #ffffff;
    --text-secondary: #7e8f9f;
    
    /* SYSTEM GLOBAL ACCENTS */
    --accent-emerald: #02b078;
    --accent-blue: #2563eb;
    --accent-amber: #d97706;
    --accent-rose: #dc2626;
}

body.light-theme {
    /* LIGHT PALETTE OVERRIDES */
    --bg-darkest: #f1f5f9;      /* Light gray canvas background */
    --bg-surface: #ffffff;      /* Pure white panels */
    --bg-component: #e2e8f0;    /* Muted gray cards */
    --bg-interactive: #cbd5e1;  /* Deeper gray hover elements */
    --border-subtle: #cbd5e1;   /* Soft slate grid split borders */
    
    --text-primary: #0f172a;    /* Dark navy text for maximum contrast */
    --text-secondary: #475569;  /* Muted slate text */
}

/* ==========================================================================
   2. SYSTEM APPLICATION RESET & BODY ENGINE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-darkest);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   3. GLOBAL BUTTON INTERACTION EFFECTS
   ========================================================================== */
.nav-btn, 
.cat-item, 
.sub-cat-btn, 
.product-card, 
.qty-btn, 
.delete-btn, 
.theme-toggle-btn,
.pad-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   4. TOP APPLICATION HEADER NAVIGATION BAR 
   ========================================================================== */
.pos-header {
    background-color: var(--bg-surface);
    border-bottom: 2px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    min-height: 55px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* THEME MODE SWITCH KEY SPECIAL RULES */
.theme-toggle-btn {
    background-color: var(--bg-interactive);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px; /* Spaces it right before Dine In */
}

.theme-toggle-btn:hover {
    filter: brightness(1.15);
}

.nav-btn {
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
}

.nav-btn:hover {
    background-color: var(--bg-interactive);
}

.nav-btn.active {
    background-color: var(--accent-emerald);
    border-color: var(--accent-emerald);
    color: #ffffff; /* Locks text light even on light mode */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-pill {
    background-color: rgba(2, 176, 120, 0.1);
    color: var(--accent-emerald);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid rgba(2, 176, 120, 0.3);
}

/* ==========================================================================
   5. THREE COLUMN SYSTEM BLOCKS INTERACTION CANVAS
   ========================================================================== */
.pos-workspace {
    display: grid;
    grid-template-columns: 140px 1fr 440px;
    flex-grow: 1;
    overflow: hidden;
}

/* COLUMN 1: VERTICAL CATEGORY NAV SIDEBAR */
.category-sidebar {
    background-color: var(--bg-surface);
    border-right: 2px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 6px;
    overflow-y: auto;
}

.cat-item {
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    padding: 14px 4px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
}

.cat-item:hover:not(.active) {
    background-color: var(--bg-interactive);
    transform: translateX(4px);
}

.cat-item.active {
    background-color: var(--accent-emerald);
    color: #ffffff;
    border-color: var(--accent-emerald);
}

.cat-item-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* COLUMN 2: CENTRAL INTERACTIVE CATALOGUE STAGE */
.menu-view-container {
    background-color: var(--bg-darkest);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.menu-sub-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.sub-categories-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.sub-cat-btn {
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
}

.sub-cat-btn:hover {
    background-color: var(--bg-interactive);
}

.sub-cat-btn.active {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.search-box-wrapper input {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    min-width: 220px;
}

/* INTERACTIVE CATALOGUE GRID LAYOUT */
.grid-scroller {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.product-card {
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 150px;
}

.product-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.product-img-fallback {
    height: 95px;
    background-color: var(--bg-interactive);
    position: relative;
}

.product-price {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--accent-emerald);
}

.product-info {
    padding: 8px 4px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-surface);
}

.product-title {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
}

/* COLUMN 3: RIGHT PANEL CHECKOUT LEDGER LAYOUT */
.checkout-sidebar {
    background-color: var(--bg-surface);
    border-left: 2px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.customer-meta-section {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.meta-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-input-group label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: bold;
}

.meta-input-group select, .meta-input-group input {
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
}

.order-table-header {
    display: grid;
    grid-template-columns: 1.8fr 1fr 0.8fr 0.4fr;
    padding: 10px 14px;
    background-color: var(--bg-component);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: bold;
    border-bottom: 1px solid var(--border-subtle);
}

.order-items-list {
    flex-grow: 1;
    overflow-y: auto;
}

.order-row {
    display: grid;
    grid-template-columns: 1.8fr 1fr 0.8fr 0.4fr;
    padding: 12px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
}

.item-details-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-modifiers-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.qty-controls {
    display: flex;
    align-items: center;
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    width: fit-content;
}

.qty-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.85rem;
}

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

.qty-value {
    padding: 0 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.item-price-calc {
    text-align: right;
    padding-right: 4px;
}

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

.delete-btn:hover {
    color: var(--accent-rose);

transform: scale(1.1);}
/* ==========================================================================6. BOTTOM SUMMARY METRICS PRICING DRAWER========================================================================== */
.billing-summary-box {
    padding: 14px;
    background-color: var(--bg-component);
    border-top: 2px solid var(--border-subtle);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.summary-row strong {
    color: var(--text-primary);
}
.text-danger {
    color: var(--accent-rose);
}
.summary-row.grand-total {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: bold;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-subtle);
}
.grand-total .final-price-tag {
    color: var(--accent-emerald);
} /* FINANCIAL COMMANDPAD SYSTEM ACTIONS */
.action-pad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.pad-btn {
    padding: 10px 4px;
    border: none;
    border-radius: 4px;
    color: #ffffff; /* Forces light text across both layouts */
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
}
.pad-btn:hover {
    filter: brightness(1.15);
}
.pad-btn:active,
.product-card:active {
    transform: scale(0.96);
}
.pad-btn.blue {
    background-color: var(--accent-blue);
}
.pad-btn.orange {
    background-color: var(--accent-amber);
}
.pad-btn.red {
    background-color: var(--accent-rose);
}
.pad-btn.green {
    background-color: var(--accent-emerald);
    grid-column: span 3;
    padding: 12px;
    font-size: 0.95rem;
    margin-top: 4px;
}

/* ==========================================================================
   8. RESPONSIVE MOBILE VIEWPORTS ENGINE (SCREENS <= 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* 1. Force the page to stay locked to the viewport with zero margin spill */
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0;
        padding: 0;
    }

    /* 2. Fix the header width containment issue */
    .pos-header {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 12px; /* Slight squeeze to ensure full mobile view visibility */
    }
	
	
    /* Transform the top header button box into a horizontal scrolling container */
    .pos-header .header-left {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;     /* Enables horizontal touch scrolling */
        white-space: nowrap !important;   /* Prevents the buttons from stacking vertically */
        gap: 8px !important;
        max-width: calc(100vw - 120px) !important; /* Limits width so it leaves space for the right status indicators */
        padding: 4px 0 !important;
        
        /* Optional: Hides the ugly default desktop scrollbar tracks to keep touch UI completely clean */
        -webkit-overflow-scrolling: touch;
    }
    .pos-header .header-left::-webkit-scrollbar {
        display: none;
    }

    /* Prevent header buttons from shrinking or compressing when text is long */
    .pos-header .nav-btn,
    .pos-header .theme-toggle-btn {
        flex: 0 0 auto !important; 
        padding: 8px 14px !important;
    }
	
    
    /* Hide the global right header clock block to save space */
    .pos-header .header-right .system-time,
    .pos-header .header-right .terminal-id {
        display: none;
    }

    /* Collapse the 3-Column Grid down into a single flexible stack */
    .pos-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        position: relative;
    }

    /* Transform Left Sidebar into a top-scrolling horizontal ribbon bar */
    .category-sidebar {
        flex-direction: row;
        border-right: none;
        border-bottom: 2px solid var(--border-subtle);
        padding: 8px;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        height: auto;
    }

    .cat-item {
        padding: 8px 16px;
        flex: 0 0 auto; /* Prevents button boxes from shrinking */
    }

    .cat-item:hover:not(.active) {
        transform: none; /* Disables slideout translation animation on touch mobile panels */
    }

    /* Expand center grid container view to take up full available canvas width */
    .menu-view-container {
        width: 100%;
    }

    /* Slightly scale down item cards to allow more columns on small touch displays */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 8px;
    }

    .product-card {
        height: 135px;
    }

    .product-img-fallback {
        height: 80px;
    }

    /* Transform the Checkout Sidebar into a 100% full-screen drawer layout overlay */
    .checkout-sidebar {
        position: fixed;   /* Changed from absolute to fixed relative to viewport bounds */
        top: 0;            /* Covers the screen starting directly from the very top pixel edge */
        left: 0;
        width: 100%;
        height: 100%;      /* Forces full window vertical axis saturation coverage */
        border-left: none;
        z-index: 1000;     /* Elevated layering stack index position to pop over navbar paths */
        transform: translateY(100%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Active dynamic toggle state modifier */
    .checkout-sidebar.mobile-open {
        transform: translateY(0);
    }
    

    /* Show and style the mobile cart button overlay block */
    /* Show and style the mobile cart button as a full-width bottom bar */
    .mobile-cart-toggle {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--accent-emerald);
        color: #ffffff;
        border: none;
        padding: 16px;
        font-size: 1.05rem;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
        cursor: pointer;
        z-index: 980;
        border-radius: 0; /* Removes round pill corners so it sits flat against the edge */
		z-index: 1010; /* Boosted past 1000 to remain accessible over the full screen drawer */
    }
    /* Creates padding at the bottom of the grid area so food items clear the fixed button bar */
    .grid-scroller {
        padding-bottom: 70px; 
    }
	
	/* 
	   BUG FIX: Prevents the fixed full-width mobile button bar 
	   from clipping or covering up the green submission pad keys
	*/
	.checkout-sidebar {
	    box-sizing: border-box !important;
	}

	.checkout-sidebar .billing-summary-box {
	    /* 
	       Gives the bottom drawer pricing block 74px of absolute extra 
	       padding space so the scroll track can clear the fixed footer completely
	    */
	    padding-bottom: 74px !important;
	    margin-bottom: 0 !important;
	}
    
}

/* Hide mobile trigger overlays on normal tablet landscape viewports */
@media screen and (min-width: 769px) {
    .mobile-cart-toggle {
        display: none;
    }
}


/* ==========================================================================
   9. CHECKOUT LEDGER THUMBNAILS EXTENSION
   ========================================================================== */

/* Wraps the photo and the title text fields inside an orderly flex layout row */
.item-row-left-group {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

/* Perfect square item previews configuration specs */
.cart-item-thumb {
    width: 42px;
    height: 42px;
    border-radius: 6px; /* Smooth rounded square boundary lines */
    background-size: cover;
    background-position: center;
    background-color: var(--bg-interactive);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0; /* Prevents text bounds from compressing the photo bounding box */
}

/* Adjust layout spacing inside row structures since we injected an element */
.order-row {
    grid-template-columns: 2.1fr 0.9fr 0.7fr 0.3fr !important; /* Tweaked spacing proportions */
}


/* ==========================================================================
   10. EMPTY CART PLACEHOLDER SYSTEM DESIGN
   ========================================================================== */
.empty-cart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
    box-sizing: border-box;
}

.empty-cart-icon {
    font-size: 2.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-cart-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-cart-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 220px;
    line-height: 1.4;
}


/* ==========================================================================
   11. CONTEXTUAL POPUP CALCULATOR THEME SPEC
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 15, 20, 0.7);
    backdrop-filter: blur(4px); /* Sleek backdrop frost effect */
    z-index: 2000;              /* Layered safely over full screen mobile panels */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Hidden state configurations by default */
    visibility: hidden;
    opacity: 0;
    transition: all 0.25s ease;
}

/* Modifier class to pop modal window open inside viewport canvas */
.modal-overlay.open {
    visibility: visible;
    opacity: 1;
}

.modal-card {
    background-color: var(--bg-surface);
    border: 2px solid var(--border-subtle);
    width: 340px;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.close-x-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: bold;
}

.close-x-btn:hover { color: var(--accent-rose); }

/* DIGITAL MONITOR VIEW SCREEN SCREEN WINDOW */
.modal-display-wrapper {
    background-color: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    box-sizing: border-box;
}

.display-context-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.display-main-digits {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* 4x4 KEY GRID SYSTEM SPECIFICATION */
.modal-numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.modal-numpad-grid button {
    height: 54px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    background-color: var(--bg-component);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

/* Tactile mouse focus button highlights states matching global specs */
.modal-numpad-grid button:hover { filter: brightness(1.15); }
.modal-numpad-grid button:active { transform: scale(0.95); }

.modal-numpad-grid .zero-span { grid-column: span 2; }

/* Dynamic layout button color templates map */
.modal-numpad-grid .action-key.orange { background-color: var(--accent-amber); color: #ffffff; }
.modal-numpad-grid .action-key.red { background-color: var(--accent-rose); color: #ffffff; }
.modal-numpad-grid .action-key.green { background-color: var(--accent-emerald); color: #ffffff; grid-column: span 2; }



/* ==========================================================================
   14. ADVANCED 3D HARDWARE BUTTON ELEVATION EFFECTS
   ========================================================================== */

/* 1. Base Configuration Upgrade for Layout Action Triggers */
.nav-btn, 
.cat-item, 
.sub-cat-btn, 
.qty-btn, 
.theme-toggle-btn,
.num-key,
.action-key,
.pad-btn {
    border-bottom: 3px solid rgba(0, 0, 0, 0.4) !important; /* Fixed dark under-edge ridge */
    border-right: 1px solid rgba(0, 0, 0, 0.2) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 
                0 4px 6px rgba(0, 0, 0, 0.3) !important; /* Soft raised drop shadow shadow */
    position: relative;
    top: 0;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Snappier timing curve for hardware clicks */
}

/* 2. Light Mode Custom Under-Edge Color Balancer overrides */
body.light-theme .nav-btn,
body.light-theme .cat-item,
body.light-theme .sub-cat-btn,
body.light-theme .qty-btn,
body.light-theme .theme-toggle-btn,
body.light-theme .num-key,
body.light-theme .action-key,
body.light-theme .pad-btn {
    border-bottom: 3px solid rgba(15, 23, 42, 0.25) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 
                0 3px 5px rgba(15, 23, 42, 0.15) !important;
}

/* 3. Product Catalog Grid Cards Dimensional Lift */
.product-card {
    border-bottom: 4px solid rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3) !important;
    top: 0;
    transition: all 0.12s ease !important;
}

body.light-theme .product-card {
    border-bottom: 4px solid rgba(15, 23, 42, 0.2) !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1) !important;
}

/* 4. Mouse-hover focus states (Gently expands the under-layer highlights) */
.nav-btn:hover, 
.sub-cat-btn:hover,
.cat-item:hover,
.theme-toggle-btn:hover,
.modal-numpad-grid button:hover,
.pad-btn:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 6px 10px rgba(0, 0, 0, 0.4) !important;
    filter: brightness(1.1) !important;
}

.product-card:hover {
    transform: translateY(-2px); /* Gentle upward float lift */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4) !important;
    border-color: var(--accent-blue) !important;
}

/* 5. OVERRIDE PHYSICAL ACTIVE CLICK MOTION (The ultimate tactile feedback) */
.nav-btn:active,
.sub-cat-btn:active,
.cat-item:active,
.qty-btn:active,
.theme-toggle-btn:active,
.modal-numpad-grid button:active,
.pad-btn:active,
.product-card:active {
    top: 2px !important; /* Physically pushes the button down into the screen canvas */
    border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important; /* Compresses the dark bottom shadow ridge */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 
                0 1px 2px rgba(0, 0, 0, 0.2) !important; /* Swaps the shadow to look pressed inward */
    transform: scale(0.98) !important;
    filter: brightness(0.95) !important;
}

/* 6. Special Elevated Rule for the Huge Green Checkout Pad Button */
.pad-btn.green {
    border-bottom: 4px solid #016e4b !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 
                0 6px 14px rgba(2, 176, 120, 0.3) !important;
}

.pad-btn.green:active {
    border-bottom: 1px solid #016e4b !important;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4) !important;
}


/* ==========================================================================
   15. PROFESSIONAL THERMAL TICKET RECEIPT MODAL THEME
   ========================================================================== */
.receipt-paper-roll {
    background-color: #faf9f5; /* Authentic thermal ticket off-white bone shade */
    color: #111111;            /* Crisp high-contrast rich ink imprint black */
    width: 330px;
    border-radius: 4px;
    padding: 20px 16px 0 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    
    /* Strict classic accounting printer monospaced font families stacking */
    font-family: "Courier New", Courier, monospace;
}

/* Elegant mock zig-zag paper cut effect running across the bottom boundary line */
.receipt-paper-roll::after {
    content: "";
    position: absolute;
    bottom: 50px; /* Aligns precisely directly right on top of the green accept key */
    left: 0;
    width: 100%;
    height: 10px;
    background-image: linear-gradient(135deg, #faf9f5 5px, transparent 0), 
                      linear-gradient(225deg, #faf9f5 5px, transparent 0);
    background-position: left bottom;
    background-size: 10px 10px;
    background-repeat: repeat-x;
}

.receipt-header {
    text-align: center;
    margin-bottom: 8px;
}

.receipt-store-name {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.receipt-store-sub {
    font-size: 0.75rem;
    color: #444444;
}

.receipt-meta-divider {
    font-size: 0.85rem;
    text-align: center;
    letter-spacing: -1px;
    line-height: 1;
    margin: 4px 0;
}

.receipt-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.receipt-table-header {
    display: grid;
    grid-template-columns: 1.8fr 0.6fr 1fr;
    font-size: 0.75rem;
    font-weight: 900;
}

.receipt-items-scroller {
    max-height: 180px;
    overflow-y: auto;
}

.receipt-item-row {
    display: grid;
    grid-template-columns: 1.8fr 0.6fr 1fr;
    font-size: 0.75rem;
    padding: 3px 0;
    font-weight: bold;
}

.receipt-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.receipt-summary-row.grand-total-line {
    font-size: 0.95rem;
    font-weight: 900;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px double #111111;
}

.receipt-footer {
    text-align: center;
    padding: 10px 0 24px 0; /* Leaves spacing for the zig-zag cut vector */
}

.receipt-thanks {
    font-size: 0.8rem;
    font-weight: 900;
    margin-bottom: 12px;
}

/* AUTHENTIC RETAIL BARCODE BLOCK DESIGN */
.receipt-barcode-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
}

.barcode-stripe-mock {
    width: 160px;
    height: 28px;
    /* Clean linear repeating gradient stripes mapping authentic scanner patterns */
    background: repeating-linear-gradient(
        90deg,
        #111,
        #111 2px,
        #faf9f5 2px,
        #faf9f5 5px,
        #111 5px,
        #111 8px,
        #faf9f5 8px,
        #faf9f5 9px
    );
}

.barcode-digits-lbl {
    font-size: 0.65rem;
    letter-spacing: 1px;
}

/* FULL-WIDTH FLUSH DISMISSAL REVENUE BUTTON BAR */
.receipt-confirm-action-btn {
    width: calc(100% + 32px);
    margin-left: -16px;
    height: 52px;
    background-color: var(--accent-emerald);
    color: #ffffff !important;
    border: none;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.receipt-confirm-action-btn:hover { background-color: #019c6a; }
.receipt-confirm-action-btn:active { background-color: #017a53; }

/* ==========================================================================
   16. RECEIPT BRAND LOGO EXTENSION CONFIGURATION
   ========================================================================== */
.receipt-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 12px; /* Spaces it cleanly directly above your store title text */
}

.receipt-brand-logo {
    max-width: 90px;      /* Keeps the emblem locked onto an elegant accounting layout scale */
    height: auto;         /* Preserves height proportions precisely */
    object-fit: contain;
    
    /* 
       DESIGN TOUCH: Adds a clean high-contrast black effect for 
       standard color photos to simulate thermal ribbon ink printing
    */
    filter: grayscale(1) contrast(2); 
    opacity: 0.9;
}


/* ==========================================================================
   17. THERMAL INVOICE DOWNLOAD ACTION TRIGGER STYLE
   ========================================================================== */
.receipt-download-action-btn {
    width: calc(100% + 32px);
    margin-left: -16px;
    height: 46px;
    background-color: var(--accent-blue);
    color: #ffffff !important;
    border: none;
    font-family: "Courier New", Courier, monospace;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-bottom: 2px solid rgba(0,0,0,0.2);
    margin-bottom: 4px; /* Slight margin cushion so it stacks elegantly above the Accept bar */
}

.receipt-download-action-btn:hover { filter: brightness(1.1); }
.receipt-download-action-btn:active { transform: scale(0.99); }


/* ==========================================================================
   18. REUSABLE CUSTOM BOILERPLATE MODAL CANVAS THEME
   ========================================================================== */
.modal-body-content {
    min-height: 120px;          /* Ensures structural padding height if content is thin */
    max-height: 60vh;           /* Auto-adds scrolling if content gets excessively tall */
    overflow-y: auto;
    padding: 12px 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

/* Footer layout action button presentation states */
.modal-footer-actions button {
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.modal-footer-actions .footer-btn-cancel {
    background-color: var(--bg-interactive);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.modal-footer-actions .footer-btn-cancel:hover { color: var(--text-primary); }

.modal-footer-actions .footer-btn-confirm {
    background-color: var(--accent-blue);
    color: #ffffff;
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
}
.modal-footer-actions .footer-btn-confirm:hover { filter: brightness(1.15); }
.modal-footer-actions .footer-btn-confirm:active { transform: scale(0.96); }


/* ==========================================================================
   20. RESPONSIVE MOBILE SEARCH TRIGGER OVERRIDES
   ========================================================================== */

/* By default, hide the mobile anchor button view on widescreen desktop setups */
.mobile-search-view-btn {
    display: none;
}

@media screen and (max-width: 768px) {
    /* Hide the standard desktop text typing box entirely */
    .search-box-wrapper .desktop-search-view {
        display: none !important;
    }

    /* Transform the mobile <a> anchor link into a smaller, compact touch block */
    .mobile-search-view-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background-color: var(--bg-component);
        border: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        
        /* Spacing updates: Made it less tall and narrower */
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
        font-weight: bold;
        text-decoration: none;
        
        /* Size limits: Prevent it from taking 100% full width */
        width: auto !important;
        min-width: 130px !important;
        max-width: 160px !important;
        border-radius: 4px;
        box-sizing: border-box;
        border-bottom: 2px solid rgba(0, 0, 0, 0.3);
        
        /* 
           CRITICAL INTERACTION FIX: Elevates the button layer so 
           the touch inputs register immediately without being blocked
        */
        position: relative !important;
        z-index: 1020 !important; /* Raised higher than the mobile cart footer elements */
    }
    
    .mobile-search-view-btn:active {
        transform: scale(0.95) !important;
        background-color: var(--bg-interactive);
    }
	
	.product-card {
	        height: 150px !important; /* Changed from 135px back to 150px */
	    }

	    .product-img-fallback,
	    .product-img {
	        height: 95px !important;  /* Changed from 80px back to 95px */
	    }
}

/* ==========================================================================
   23. UNIFIED GLOBAL GRID/LIST CATALOGUE STATE STYLES (ANY DEVICE)
   ========================================================================== */

/* 1. Global Icon Button Layout Rules */
.global-icon-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-component);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    width: 36px !important;
    height: 36px !important;
    font-size: 1.05rem !important;
    border-radius: 4px;
    text-decoration: none;
    box-sizing: border-box;
    border-bottom: 2px solid rgba(0, 0, 0, 0.4);
    transition: all 0.1s ease;
}

.global-icon-btn:hover { filter: brightness(1.15); }
.global-icon-btn:active { transform: scale(0.95); }

/* Hide the duplicate popup lens button on desktop monitors since the text input is already visible */
.mobile-only-search-btn { display: none; }

@media screen and (max-width: 768px) {
    .mobile-only-search-btn { display: flex !important; }
}

/* 2. DYNAMIC COMPRESSED RECENT LIST-VIEW ENGINE */
.products-grid.list-view-mode {
    grid-template-columns: 1fr !important; /* Locks columns down to a single wide tracking row list */
    gap: 8px !important;
}

.products-grid.list-view-mode .product-card {
    flex-direction: row !important;        /* Swaps image elements horizontally next to text fields */
    height: 60px !important;                /* Slim, high-density row profile bounding box dimensions */
    align-items: center;
}

.products-grid.list-view-mode .product-img-fallback,
.products-grid.list-view-mode .product-img {
    width: 60px !important;                 /* Squares image down into a clean inline list thumbnail */
    height: 60px !important;
    flex-shrink: 0;
}

.products-grid.list-view-mode .product-price {
    position: static !important;            /* Removes floating absolute positioning layer anchors */
    margin-right: 12px;
    font-size: 0.85rem !important;
    border: none !important;
}

.products-grid.list-view-mode .product-info {
    flex-grow: 1;
    display: flex !important;
    justify-content: space-between !important; /* Pushes product description title to left, price to right */
    padding: 0 16px !important;
    text-align: left !important;
    height: 100%;
    background-color: transparent !important;  /* Blends background evenly with card skin variables */
}

.products-grid.list-view-mode .product-info .product-title {
    font-size: 0.85rem !important;
    font-weight: bold;
}



/* ==========================================================================
   UPDATED FLAG BADGE DESIGN SPEC
   ========================================================================== */

/* 1. Ensure the parent card is explicitly set to relative */
.product-card {
    position: relative !important; /* Establishes a container wall for the absolute badge */
    overflow: visible !important;   /* Let the badge render cleanly on edges */
}

/* 2. Position the badge cleanly right on top of the image corner box */
.product-card.item-in-cart-flagged::before {
    content: "✓";
    position: absolute !important;
    
    /* Perfect corner positioning coordinates */
    top: -6px !important;    /* Slightly offsets it on the top border for a modern look */
    left: -6px !important;   /* Slightly offsets it on the left border */
    
    /* Explicit square sizing rules */
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important; /* Forces a perfect circle shape */
    
    /* Branding Accent Styles matching global specs */
    background-color: var(--accent-emerald) !important;
    color: #ffffff !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
    
    /* Centering the checkmark inside the circle */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Adds depth so it pops clearly over food photos */
    box-shadow: 0 3px 8px rgba(0,0,0,0.4) !important;
    z-index: 99 !important; /* Layers safely over price badges and fallbacks */
}


/* ==========================================================================
   25. COMPACT STACKED DISCOUNT / SALE PRICING MATRIX
   ========================================================================== */

/* 1. Anchors the pricing block to the top-right corner of the image fallback container */
.product-price-badge-dock {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    flex-direction: column; /* Stacks the old price directly over the new deal text */
    align-items: flex-end;
    gap: 2px;
    z-index: 20;
}

/* 2. Style the original slashed pricing tag */
.price-was {
    font-size: 0.68rem !important;
    font-weight: bold;
    color: var(--text-secondary);
    background-color: var(--bg-darkest);
    border: 1px solid var(--border-subtle);
    padding: 1px 4px;
    border-radius: 3px;
    text-decoration: line-through; /* Draws a clean cross-out strike line across digits */
    opacity: 0.75;
}

/* 3. Style the bold new active promotional value text badge */
.product-price.sale-deal-active {
    position: static !important; /* Clears absolute rules so it respects the container stack */
    background-color: var(--accent-rose) !important; /* Turns badge a high-contrast danger red */
    color: #ffffff !important;                      /* Keeps currency text locked to bright white */
    border-color: var(--accent-rose) !important;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* 4. BALANCED SPACING RE-ALIGNMENT FOR THE GLOBAL LIST VIEW SCROLLER */
.products-grid.list-view-mode .product-price-badge-dock {
    position: static !important; /* Removes absolute floating coordinates in list mode */
    flex-direction: row-reverse !important; /* Arranges old price and new price horizontally */
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.products-grid.list-view-mode .price-was {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.products-grid.list-view-mode .product-price.sale-deal-active {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--accent-rose) !important; /* Keeps text red in list mode for scanning clarity */
}


/* ==========================================================================
   26. CART THUMBNAIL INTERACTIVE PREVIEW MODAL SPEC
   ========================================================================== */

/* Gives the miniature item thumbnail a pointer hand indicator on hover */
.order-items-list .cart-item-thumb {
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

/* Tactile visual confirmation highlight when tapped */
.order-items-list .cart-item-thumb:hover {
    filter: brightness(1.15);
}
.order-items-list .cart-item-thumb:active {
    transform: scale(0.92);
}

/* Big centered image preview presentation rules for inside the modal box */
.modal-image-preview-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 6px 0;
    box-sizing: border-box;
}

.modal-preview-photo {
    width: 100%;
    max-width: 280px;      /* Restricts boundaries neatly inside the modal card footprint */
    height: 220px;
    object-fit: cover;     /* Prevents your menu pictures from warping or stretching */
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   27. DYNAMIC CART SERVICE MODE STATUS HEADER BADGE
   ========================================================================== */
.cart-context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-interactive);
    border: 1px solid var(--border-subtle);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px; /* Spacing cushion to divide it elegantly from the financials grid */
    box-sizing: border-box;
    border-left: 4px solid var(--accent-blue); /* Solid blue structural indicator notch */
}

/* Base description subtitle text styling specifications */
.context-label-txt {
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* Bold highlighted active value string indicator */
.context-badge-val {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--accent-blue);
    text-transform: uppercase; /* Guarantees standard caps layout styling output uniformity */
    letter-spacing: 0.5px;
}

/* SQUASH ADJUSTMENT SPECIFICS FOR COMPRESSED LIST VIEW VIEWER COORD SHEETS */
body.light-theme .cart-context-header {
    background-color: rgba(15, 23, 42, 0.04);
}


/* ==========================================================================
   28. FIXED WORKSPACE CONTEXTUAL COLOR THEMES
   ========================================================================== */

/* 
   FIX RUNNER: We explicitly specify [data-color] so the selector weight 
   wipes out any generic .nav-btn.active rules inherited earlier!
*/

/* --- Category 1: Emerald (Dine In Preset Defaults) --- */
.nav-btn.active[data-color="emerald"] {
    background-color: var(--accent-emerald) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #017a53 !important;
}
.cart-context-header.theme-emerald {
    border-left-color: var(--accent-emerald) !important;
}
.cart-context-header.theme-emerald .context-badge-val {
    color: var(--accent-emerald) !important;
}

/* --- Category 2: Amber (Take Away Options) --- */
.nav-btn.active[data-color="amber"] {
    background-color: var(--accent-amber) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #c2410c !important;
}
.cart-context-header.theme-amber {
    border-left-color: var(--accent-amber) !important;
}
.cart-context-header.theme-amber .context-badge-val {
    color: var(--accent-amber) !important;
}

/* --- Category 3: Cyan (Delivery Transit Loops) --- */
.nav-btn.active[data-color="cyan"] {
    background-color: var(--accent-blue) !important; /* Maps your active blue profile */
    color: #ffffff !important;
    border-bottom: 3px solid #0369a1 !important;
}
.cart-context-header.theme-cyan {
    border-left-color: var(--accent-blue) !important;
}
.cart-context-header.theme-cyan .context-badge-val {
    color: var(--accent-blue) !important;
}

/* --- Category 4: Rose (Ongoing Queue Invoices) --- */
.nav-btn.active[data-color="rose"] {
    background-color: var(--accent-rose) !important;
    color: #ffffff !important;
    border-bottom: 3px solid #be123c !important;
}
.cart-context-header.theme-rose {
    border-left-color: var(--accent-rose) !important;
}
.cart-context-header.theme-rose .context-badge-val {
    color: var(--accent-rose) !important;
}




