/* ==========================================================================
   MAN.KO Resto Cafe — Core Design System & Customer Application Styles
   Theme: Warm Open-Air Night Ambient (#14100d background, #e8d44d yellow, #2d6a4f teal)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
    /* Color Palette */
    --bg-main: #14100d;
    --bg-surface: #1a1512;
    --bg-card: #221c18;
    --bg-glass: rgba(34, 28, 24, 0.85);
    --border-color: rgba(232, 212, 77, 0.15);
    
    --yellow-accent: #e8d44d;
    --yellow-hover: #f3e26b;
    --teal-accent: #2d6a4f;
    --teal-light: #40916c;
    --amber-gold: #d97706;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --veg-color: #22c55e;
    --non-veg-color: #ef4444;
    --special-color: #e8d44d;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Layout & Shadows */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(232, 212, 77, 0.2);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* Header & Hero Section */
.hero-header {
    position: relative;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(26,21,18,0.95) 0%, rgba(20,16,13,0.8) 100%), 
                url('../assets/hero-bg.svg') center/cover no-repeat;
    border-bottom: 1px solid var(--border-color);
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--yellow-accent);
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--yellow-accent);
    letter-spacing: 0.02em;
}

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

.table-badge-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--teal-accent);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Search & Dietary Filter Controls */
.controls-container {
    max-width: 900px;
    margin: 1.5rem auto 1rem;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--yellow-accent);
    box-shadow: 0 0 0 3px rgba(232, 212, 77, 0.15);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.filter-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
    background: var(--yellow-accent);
    color: #14100d;
    font-weight: 600;
}

/* Category Navigation Sticky Tabs */
.sticky-tabs-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.category-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    max-width: 1000px;
    margin: 0 auto;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.category-tab:hover {
    color: var(--yellow-accent);
}

.category-tab.active {
    background: rgba(232, 212, 77, 0.15);
    border-color: var(--yellow-accent);
    color: var(--yellow-accent);
    font-weight: 600;
}

/* Menu Items Grid */
.menu-container {
    max-width: 1100px;
    margin: 1.5rem auto 6rem;
    padding: 0 1rem;
}

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

.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.menu-card:hover {
    transform: translateY(-3px);
    border-color: rgba(232, 212, 77, 0.4);
    box-shadow: var(--shadow-soft);
}

.menu-card.sold-out {
    opacity: 0.6;
    filter: grayscale(0.7);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-price {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--yellow-accent);
}

.item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
}

.add-to-cart-btn {
    background: var(--teal-accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.add-to-cart-btn:hover {
    background: var(--teal-light);
}

.sold-out-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--non-veg-color);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Dietary Tag Badges */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-badge.veg {
    color: var(--veg-color);
}

.tag-badge.veg .dot {
    width: 8px;
    height: 8px;
    background: var(--veg-color);
    border-radius: 50%;
}

.tag-badge.non-veg {
    color: var(--non-veg-color);
}

.tag-badge.non-veg .triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 9px solid var(--non-veg-color);
}

.tag-badge.special {
    color: var(--special-color);
}

/* Floating Bottom Cart Bar */
.floating-cart-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 2rem);
    max-width: 500px;
    background: var(--yellow-accent);
    color: #14100d;
    padding: 0.9rem 1.5rem;
    border-radius: var(--radius-full);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(232, 212, 77, 0.4);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-cart-bar.active {
    transform: translateX(-50%) translateY(0);
}

.badge-circle {
    background: #14100d;
    color: var(--yellow-accent);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

/* Drawer & Modal Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.active {
    transform: translateX(0);
}

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

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

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.order-type-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.order-type-selector label {
    flex: 1;
    text-align: center;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.order-type-selector input[type="radio"] {
    display: none;
}

.order-type-selector input[type="radio"]:checked + label {
    background: var(--teal-accent);
    color: #fff;
}

.cart-drawer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.5rem;
}

.cart-qty-btn {
    background: none;
    border: none;
    color: var(--yellow-accent);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: 20px;
}

.drawer-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.invoice-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.invoice-summary .row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.invoice-summary .row.total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--yellow-accent);
    border-top: 1px dashed var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.btn-submit-order {
    width: 100%;
    background: var(--yellow-accent);
    color: #14100d;
    border: none;
    padding: 1rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-submit-order:hover {
    background: var(--yellow-hover);
}

.btn-submit-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modals */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 500px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-soft);
    padding: 1.75rem;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* Spinner Loader */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(232, 212, 77, 0.2);
    border-top-color: var(--yellow-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
