/* Font import rimosso per permettere il funzionamento offline senza rallentamenti. I font di sistema (system-ui) garantiscono ottime prestazioni e stabilità. */
:root {
    /* Color Palette - Light Mode */
    --bg-base: hsl(210, 30%, 95%);
    --bg-surface: hsl(0, 0%, 100%);
    --bg-surface-glass: hsla(0, 0%, 100%, 0.85);
    --border-color: hsl(210, 15%, 86%);
    --border-color-glow: hsla(201, 100%, 43%, 0.2);
    
    --color-primary: hsl(201, 100%, 40%); /* Premium Royal Azure Blue (adjusted for readability) */
    --color-primary-hover: hsl(201, 100%, 35%);
    --color-primary-glow: hsla(201, 100%, 43%, 0.15);
    
    --text-main: hsl(218, 40%, 16%);
    --text-muted: hsl(215, 15%, 45%);
    --text-dark: hsl(218, 40%, 16%);
    
    /* Order/Item Status Colors */
    --status-pending: hsl(40, 95%, 43%);     /* Amber/Yellow (from logo) */
    --status-validated: hsl(199, 90%, 43%);   /* Azure Blue (from logo) */
    --status-preparing: hsl(28, 90%, 45%);     /* Warm Fire Orange (In preparation) */
    --status-ready: hsl(142, 72%, 33%);       /* Leaf Green (from logo) */
    --status-delivered: hsl(215, 16%, 45%);   /* Steel Slate */
    --color-danger: hsl(0, 75%, 50%);
    --color-danger-hover: hsl(0, 75%, 45%);
    
    /* Font Declarations */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Layout Sizes */
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-main: 0 8px 30px rgba(10, 20, 40, 0.06);
    --shadow-glow: 0 0 20px hsla(201, 100%, 40%, 0.08);
}

/* Global Reset & Basic Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image: 
        radial-gradient(at 0% 0%, hsla(201, 100%, 40%, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(142, 72%, 33%, 0.04) 0px, transparent 50%),
        radial-gradient(at 50% 50%, hsla(40, 95%, 43%, 0.02) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-glow);
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.6rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* Main Layout Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-main);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-main);
    text-decoration: none;
}

.logo span {
    color: var(--color-primary);
}

.logo-img {
    height: 38px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    background-color: white;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.08) rotate(-3deg);
    border-color: var(--color-primary);
}

/* Glass Card */
.card {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: var(--border-color-glow);
    box-shadow: var(--shadow-main), var(--shadow-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

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

.btn:active {
    transform: translateY(0);
}

.btn.disabled, .btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-main);
    transform: none;
    box-shadow: none;
}

.btn-success {
    background: var(--status-ready);
    box-shadow: 0 4px 12px hsla(142, 72%, 43%, 0.2);
}
.btn-success:hover {
    background: hsl(142, 72%, 48%);
    box-shadow: 0 6px 16px hsla(142, 72%, 43%, 0.3);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    box-shadow: 0 4px 12px hsla(0, 75%, 50%, 0.2);
}
.btn-danger:hover {
    background: var(--color-danger-hover);
    box-shadow: 0 6px 16px hsla(0, 75%, 50%, 0.3);
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}
.btn-whatsapp:hover {
    background: #20ba5a;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.badge-pending {
    background: hsla(40, 95%, 43%, 0.08);
    color: var(--status-pending);
    border-color: hsla(40, 95%, 43%, 0.25);
}

.badge-validated {
    background: hsla(199, 90%, 43%, 0.08);
    color: var(--status-validated);
    border-color: hsla(199, 90%, 43%, 0.25);
}

.badge-preparing {
    background: hsla(28, 90%, 45%, 0.08);
    color: var(--status-preparing);
    border-color: hsla(28, 90%, 45%, 0.25);
}

.badge-ready {
    background: hsla(142, 72%, 33%, 0.08);
    color: var(--status-ready);
    border-color: hsla(142, 72%, 33%, 0.25);
}

.badge-delivered {
    background: hsla(215, 16%, 45%, 0.08);
    color: var(--status-delivered);
    border-color: hsla(215, 16%, 45%, 0.25);
}

.badge-danger {
    background: hsla(0, 75%, 50%, 0.08);
    color: var(--color-danger);
    border-color: hsla(0, 75%, 50%, 0.25);
}

/* Customer Menu & Order Form */
.menu-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

.menu-category-section {
    margin-bottom: 30px;
}

.category-title {
    color: var(--color-primary);
    font-size: 1.25rem;
    margin-bottom: 15px;
    padding-left: 6px;
    border-left: 3px solid var(--color-primary);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.15s ease;
}

.category-title:hover {
    opacity: 0.8;
}

.category-title-arrow {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-right: 10px;
}

.category-title-arrow.collapsed {
    transform: rotate(-90deg);
}

.menu-items-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.menu-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: transform 0.2s, border-color 0.2s;
}

.menu-item-card:hover {
    transform: translateX(4px);
    border-color: var(--border-color-glow);
}

.item-info h4 {
    font-size: 1.1rem;
    
}

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

.item-price {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.15rem;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Inputs & Form Fields */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* Cart Summary Card */
.cart-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-items {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
}

.cart-item-notes {
    font-size: 0.8rem;
    color: var(--color-primary);
    margin-top: 2px;
}

.cart-item-price {
    text-align: right;
    font-size: 0.95rem;
}

.cart-item-edit {
    background: transparent;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 4px;
    margin-right: 10px;
}

.cart-item-edit:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.cart-item-remove {
    background: transparent;
    border: none;
    color: hsl(0, 70%, 60%);
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 4px;
}

.cart-item-remove:hover {
    color: hsl(0, 80%, 70%);
    text-decoration: underline;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 2px dashed var(--border-color);
}

.cart-total span:last-child {
    color: var(--color-primary);
    font-family: var(--font-heading);
}

/* Dashboards and Panels */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

@media (max-width: 500px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.order-num {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
}

.order-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.order-items-list {
    flex-grow: 1;
    margin-bottom: 20px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.03);
}

.order-item-row.prepared {
    text-decoration: line-through;
    color: var(--text-muted);
}

.order-item-row .notes {
    font-size: 0.8rem;
    color: var(--color-primary);
    display: inline-block;
    margin-left: 8px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.order-total-price {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
}

/* Filter selector tabs */
.tabs-header {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--color-primary);
    color: var(--text-main);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

/* Alert Notification Banner */
.notification {
    padding: 16px;
    background: hsla(16, 100%, 55%, 0.1);
    border: 1px solid var(--color-primary-glow);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Note textarea popup for menu addition */
.notes-input-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.notes-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-main);
}

/* Compact & High-Density Styles */
.search-bar {
    width: 100%;
    margin-bottom: 16px;
}

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

.compact-card {
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.compact-card .order-num {
    font-size: 1.15rem;
}

.compact-card h3 {
    font-size: 1.05rem;
}

.compact-card .order-meta {
    margin-bottom: 8px;
    padding-bottom: 4px;
    font-size: 0.8rem;
}

.compact-card .order-items-list {
    margin-bottom: 8px;
}

.compact-card .order-item-row {
    font-size: 0.85rem;
    padding: 4px 0;
}

.compact-card .order-footer {
    padding-top: 8px;
}

.compact-card .progress-bar-container {
    height: 6px;
    margin: 6px 0 10px 0;
}

/* Aggregated View Styles */
.aggregated-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: var(--bg-surface-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.aggregated-table th, .aggregated-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.aggregated-table th {
    background: hsla(210, 15%, 92%, 0.7);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aggregated-table tr:last-child td {
    border-bottom: none;
}

.aggregated-table td strong {
    font-size: 1.25rem;
    color: var(--color-primary);
}

.aggregated-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: hsla(16, 100%, 55%, 0.15);
    color: var(--color-primary);
    font-weight: 700;
    font-family: var(--font-heading);
}

.aggregated-qty.preparing {
    background: hsla(271, 91%, 65%, 0.15);
    color: var(--status-preparing);
}

.aggregated-qty.pending {
    background: hsla(42, 100%, 53%, 0.15);
    color: var(--status-pending);
}

/* =========================================================================
   NEW ORDER FULLSCREEN BUILDER
   ========================================================================= */

.new-order-fullscreen-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: calc(100vh - 180px); /* Fill available height below header */
    min-height: 600px;
}

.new-order-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
    overflow: hidden;
}

.new-order-sidebar {
    width: 350px;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
}

/* Big Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 170px);
    grid-auto-rows: max-content;
    align-content: start;
    justify-content: start;
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px;
    margin-top: 15px;
    flex: 1;
}

.product-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--bg-base);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    min-height: 120px;
    user-select: none; /* Prevent text selection on rapid clicks */
    -webkit-user-select: none;
}

.product-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    border-color: var(--color-primary);
}

.product-btn:active {
    transform: scale(0.96);
}

.product-btn.unavailable {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

.product-btn .product-name {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--text-main);
}

.product-btn .product-price {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Badge for Selected Quantity on the Product Button */
.product-qty-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    min-width: 28px;
    height: 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 2px solid var(--bg-surface);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.product-qty-badge.active {
    transform: scale(1);
}

/* Decrement Mode Styling */
.decrement-mode .product-btn {
    border-color: hsla(0, 75%, 80%, 1);
}

.decrement-mode .product-btn:hover {
    border-color: var(--color-danger);
    background: hsla(0, 75%, 50%, 0.05);
}

.decrement-mode .product-qty-badge {
    background: var(--color-danger);
}

.toggle-switch-container {
    display: flex;
    align-items: center;
    background: var(--bg-base);
    border-radius: 50px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.toggle-btn.active-add {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.toggle-btn.active-remove {
    background: var(--color-danger);
    color: #fff;
    box-shadow: 0 2px 8px hsla(0, 75%, 50%, 0.3);
}

/* Cart List in Sidebar */
.sidebar-cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
    border-bottom: 1px dashed var(--border-color);
}

.sidebar-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid hsla(0,0,0,0.05);
    font-size: 0.9rem;
}

.sidebar-cart-qty {
    font-weight: 700;
    margin-right: 8px;
    color: var(--color-primary);
    min-width: 20px;
    display: inline-block;
}

.sidebar-cart-name {
    flex: 1;
}


/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 5px solid var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-width: 320px;
    max-width: 450px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: all 0.3s ease;
}

.toast.toast-error {
    border-left-color: var(--status-cancelled, #dc3545);
}

.toast.toast-success {
    border-left-color: #28a745;
}

.toast.toast-info {
    border-left-color: #17a2b8;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    text-align: left;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}

.toast-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.toast-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.toast-btn {
    background: var(--color-primary);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

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

.toast-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.toast-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 5px;
}

.toast-close:hover {
    color: #fff;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Virtual Receipt Screen Preview */
.virtual-receipt-box, .virtual-receipt-box * {
    font-weight: bold !important;
}
.virtual-receipt-box {
    background: #fff;
    color: #000;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.3;
}
.virtual-receipt-box .ticket {
    background: #fff;
    color: #000;
    width: 100%;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px dashed #ccc;
    box-sizing: border-box;
}
.virtual-receipt-box .ticket:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.virtual-receipt-box .header {
    text-align: center;
    margin-bottom: 10px;
}
.virtual-receipt-box .header h1 {
    font-size: 13px;
    margin: 4px 0;
    text-transform: uppercase;
}
.virtual-receipt-box .header p {
    font-size: 11px;
    margin: 2px 0;
}
.virtual-receipt-box .separator {
    border-top: 2px dashed #000;
    margin: 8px 0;
}
.virtual-receipt-box .order-number {
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #000;
    padding: 4px;
    text-align: center;
    margin: 8px 0;
}
.virtual-receipt-box .items-table {
    width: 100%;
    border-collapse: collapse;
}
.virtual-receipt-box .items-table td {
    padding: 3px 0;
    vertical-align: top;
    font-size: 12px;
    color: #000 !important;
}
.virtual-receipt-box .qty {
    font-weight: bold;
    width: 25px;
}
.virtual-receipt-box .price {
    text-align: right;
    width: 60px;
}
.virtual-receipt-box .total-container {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 14px;
    margin-top: 10px;
}
.virtual-receipt-box .footer {
    text-align: center;
    margin-top: 15px;
    font-size: 11px;
}
.virtual-receipt-box .footer p {
    margin: 3px 0;
}

/* Category Navigation Bar */
.category-nav-container {
    position: -webkit-sticky;
    position: sticky;
    top: 10px;
    z-index: 990;
    margin-bottom: 25px;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 15px;
    box-shadow: var(--shadow-main);
}

.category-nav-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
}

.category-nav-bar::-webkit-scrollbar {
    display: none;
}

.category-nav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-nav-pill:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.category-nav-pill.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--color-primary-glow);
}

.category-nav-pill.cart-shortcut-pill {
    margin-left: auto;
    background: hsla(142, 72%, 33%, 0.1);
    color: var(--status-ready);
    border-color: hsla(142, 72%, 33%, 0.2);
}

.category-nav-pill.cart-shortcut-pill:hover {
    background: hsla(142, 72%, 33%, 0.2);
    transform: translateY(-1px);
}

.nav-cart-badge {
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 4px;
    font-weight: 700;
    display: inline-block;
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(0.6); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.0); }
}

@media (max-width: 900px) {
    .category-nav-container {
        top: 0;
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 16px;
        margin-bottom: 20px;
        background: var(--bg-surface);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    
    .category-nav-pill {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}


/* =========================================================================
   PRINT STYLES FOR NATIVE PRINTING (KIOSK MODE)
   ========================================================================= */
@media print {
    body > *:not(#print-area) {
        display: none !important;
    }
    
    .toast-container, .toast, .notes-input-modal, .modal, #toast-container, #virtual-receipt-modal, #kiosk-warning-banner, #printing-banner {
        display: none !important;
    }
    
    body {
        background: #fff;
        padding: 0;
        margin: 0;
        display: block;
    }

    #print-area, #print-area * {
        font-weight: bold !important;
    }

    #print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 78mm;
        margin: 0;
        padding: 0;
        background: #fff;
        color: #000;
        font-family: 'Courier New', Courier, monospace;
    }

    .ticket {
        width: 74mm;
        margin: 0 auto;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        page-break-after: always;
        break-after: page;
        box-sizing: border-box;
    }

    .ticket:last-child {
        page-break-after: avoid;
        break-after: avoid;
    }

    @page {
        margin: 0;
        size: 78mm auto;
    }

    #print-area .text-center { text-align: center; }
    #print-area .header h1 { font-size: 18px; margin: 5px 0; text-transform: uppercase; }
    #print-area .header p { margin: 2px 0; font-size: 11px; }
    #print-area .separator { border-top: 2px dashed #000; margin: 10px 0; }
    #print-area .order-number { font-size: 32px; margin: 5px 0; border: 2px solid #000; padding: 5px 0; text-align: center; }
    #print-area .details-section { font-size: 11px; margin: 8px 0; text-align: left; }
    #print-area .details-section p { margin: 3px 0; }
    #print-area .items-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
    #print-area .items-table th { border-bottom: 1px solid #000; text-align: left; padding-bottom: 4px; font-size: 11px; }
    #print-area .items-table td { padding: 6px 0; vertical-align: top; font-size: 11px; }
    #print-area .qty { width: 35px; }
    #print-area .price { text-align: right; width: 70px; }
    #print-area .item-notes { font-size: 10px; font-style: italic; margin-left: 5px; }
    #print-area .total-container { margin-top: 10px; font-size: 14px; display: flex; justify-content: space-between; }
    #print-area .footer { margin-top: 20px; font-size: 10px; text-align: center; }
    #print-area .footer p { margin: 4px 0; }
}

/* Floating Cart Button for Mobile (Discreet & Elegant) */
.floating-cart-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.floating-cart-btn:hover {
    background-color: var(--color-primary-hover);
    transform: scale(1.03);
}

.floating-cart-btn:active {
    transform: scale(0.97);
}

.floating-cart-badge {
    background-color: var(--status-pending);
    color: white;
    border-radius: 12px;
    padding: 1px 6px;
    font-size: 0.75rem;
    min-width: 16px;
    text-align: center;
    font-weight: bold;
}

@media (min-width: 901px) {
    .floating-cart-btn {
        display: none !important;
    }
}

