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

:root {
    --primary: #ff6f00;
    --primary-hover: #e65c00;
    --primary-light: #fff3e0;
    --secondary: #475569;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --font-primary: 'Outfit', 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea, select {
    font-family: inherit;
}

/* Container */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px; /* Spacer for bottom cart */
}

.desktop-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.merchant-logo {
    display: flex;
    flex-direction: column;
}

.merchant-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
}

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

.table-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 111, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Horizontal Categories */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px;
    background: var(--bg-body);
    position: sticky;
    top: 69px;
    z-index: 40;
    scrollbar-width: none; /* Firefox */
}

.category-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-tab {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.25);
}

/* Product Catalog */
.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 20px 0 12px 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 111, 0, 0.2);
}

.product-image-container {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background-color: #f1f5f9;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.recommended-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--warning);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.product-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

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

/* Add / Quantity Controls */
.btn-add {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(255, 111, 0, 0.3);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(255, 111, 0, 0.2);
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--primary);
    border-radius: 50px;
    background: var(--bg-card);
    overflow: hidden;
}

.btn-qty {
    background: none;
    border: none;
    color: var(--primary);
    width: 28px;
    height: 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-qty:hover {
    background: var(--primary-light);
}

.qty-val {
    width: 24px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.out-of-stock-badge {
    background: var(--secondary);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Floating Cart Footer */
.floating-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    display: none;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.cart-summary {
    display: flex;
    flex-direction: column;
}

.cart-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cart-total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-checkout {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.35);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-checkout:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 111, 0, 0.4);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.btn-close:hover {
    color: var(--text-main);
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

/* Modifier Selections */
.modifiers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.modifier-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.modifier-option:hover {
    border-color: var(--primary);
}

.modifier-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

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

.modifier-price {
    font-weight: 600;
    color: var(--primary);
}

/* Order Summary (Checkout) */
.checkout-items {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.checkout-item:last-child {
    border-bottom: none;
}

.checkout-item-details {
    display: flex;
    flex-direction: column;
}

.checkout-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.checkout-item-mods {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.checkout-item-notes {
    font-size: 0.75rem;
    color: var(--primary);
    font-style: italic;
    margin-top: 2px;
}

.checkout-item-price {
    font-weight: 700;
    font-size: 0.95rem;
}

.checkout-totals {
    margin: 16px 0;
}

.checkout-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkout-row.grand-total {
    border-top: 1px dashed var(--border);
    padding-top: 12px;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-main);
}

.checkout-row.grand-total .total-val {
    color: var(--primary);
}

/* Payment Method Choices */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method-btn {
    border: 2px solid var(--border);
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: var(--transition);
}

.payment-method-btn:hover {
    border-color: var(--primary);
}

.payment-method-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* Order Status Tracker */
.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.status-badge.pending {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.preparing {
    background: var(--info-light);
    color: var(--info);
}

.status-badge.completed {
    background: var(--success-light);
    color: var(--success);
}

.status-steps {
    display: flex;
    justify-content: space-between;
    margin: 24px 0 12px 0;
    position: relative;
}

.status-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 4px;
    background: var(--border);
    z-index: 1;
}

.status-step {
    position: relative;
    z-index: 2;
    background: var(--bg-card);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}

.status-step.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.status-step.done {
    border-color: var(--success);
    background: var(--success);
    color: #ffffff;
}

.status-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Staff Login Screen */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ffffff 100%);
    padding: 16px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

/* Staff Dashboard Layout */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-nav-action {
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-nav-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    text-decoration: underline;
}

/* Dashboard Columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

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

.dashboard-column {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 70vh;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.column-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-badge {
    background: var(--secondary);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.column-header.pending {
    border-color: var(--warning);
}
.column-header.pending .column-badge {
    background: var(--warning);
}

.column-header.preparing {
    border-color: var(--info);
}
.column-header.preparing .column-badge {
    background: var(--info);
}

.column-header.completed {
    border-color: var(--success);
}
.column-header.completed .column-badge {
    background: var(--success);
}

.order-cards-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    animation: fadeIn 0.3s ease;
}

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.order-id-table {
    display: flex;
    flex-direction: column;
}

.order-id {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.order-table {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

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

.customer-details-box {
    margin-bottom: 12px;
    background: var(--bg-body);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.order-items-list {
    margin-bottom: 14px;
}

.order-item-row {
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.order-item-qty-name {
    font-weight: 600;
}

.order-item-mods-notes {
    padding-left: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-item-mods-notes .mod-name {
    display: inline-block;
    background: #f1f5f9;
    padding: 1px 4px;
    border-radius: 4px;
    margin-right: 4px;
}

.order-item-mods-notes .note-text {
    color: var(--primary);
    font-style: italic;
}

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

.order-price-payment {
    display: flex;
    flex-direction: column;
}

.order-card-price {
    font-weight: 700;
    font-size: 0.95rem;
}

.payment-status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    width: max-content;
}

.payment-status-badge.unpaid {
    background: var(--danger-light);
    color: var(--danger);
}

.payment-status-badge.paid {
    background: var(--success-light);
    color: var(--success);
}

.order-actions {
    display: flex;
    gap: 8px;
}

.btn-order-action {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-order-action.primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-order-action.primary:hover {
    background: var(--primary-hover);
}

.btn-order-action.success {
    background: var(--success);
    color: #ffffff;
}

.btn-order-action.success:hover {
    background: #059669;
}

/* Availability Manager Toggle Switch */
.availability-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 16px;
}

.availability-table th, .availability-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.availability-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-muted);
}

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

/* Switch Toggle Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--success);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-item {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Keyframes */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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