/* ============================================
   Damon's Glizzy's — Order Calculator
   ElevenLabs-inspired dark UI design
   ============================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    /* Colors — ElevenLabs-inspired palette */
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-card: #16161a;
    --bg-card-hover: #1c1c21;
    --bg-elevated: #1e1e24;
    --bg-input: #0e0e10;
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-active: rgba(255, 200, 55, 0.4);
    
    --text-primary: #f0f0f2;
    --text-secondary: #8e8e96;
    --text-tertiary: #5c5c66;
    --text-accent: #ffc837;
    
    --accent: #ffc837;
    --accent-dim: rgba(255, 200, 55, 0.15);
    --accent-glow: rgba(255, 200, 55, 0.3);
    
    --danger: #ff4757;
    --danger-dim: rgba(255, 71, 87, 0.15);
    
    --success: #2ed573;
    --success-dim: rgba(46, 213, 115, 0.15);
    
    /* Gradients */
    --gradient-accent: linear-gradient(135deg, #ffc837 0%, #ff8008 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 200, 55, 0.03) 0%, rgba(255, 128, 8, 0.01) 100%);
    --gradient-glow: radial-gradient(circle at center, rgba(255, 200, 55, 0.08) 0%, transparent 70%);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(255, 200, 55, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

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

/* ---------- Particle Canvas ---------- */
.particle-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* ---------- Confetti Container ---------- */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -20px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* ---------- Floating Background Orbs ---------- */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

.bg-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 200, 55, 0.12) 0%, transparent 70%);
    top: -100px;
    right: -80px;
    animation: orb-float-1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 128, 8, 0.08) 0%, transparent 70%);
    bottom: 100px;
    left: -80px;
    animation: orb-float-2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 71, 87, 0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    animation: orb-float-3 30s ease-in-out infinite;
}

@keyframes orb-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-30px, 40px) scale(1.1); }
    66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes orb-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes orb-float-3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* ---------- App Container ---------- */
.app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 160px;
}

/* ---------- Header ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.82);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: contain;
    flex-shrink: 0;
    animation: logo-pulse 4s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(255, 200, 55, 0.3));
    transition: transform var(--transition-spring);
}

.logo-img:hover {
    transform: scale(1.15) rotate(-5deg);
}

@keyframes logo-pulse {
    0%, 100% { filter: drop-shadow(0 2px 8px rgba(255, 200, 55, 0.3)); }
    50% { filter: drop-shadow(0 4px 16px rgba(255, 200, 55, 0.5)); }
}

.logo-text {
    min-width: 0;
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-subtitle {
    font-size: clamp(0.6rem, 2vw, 0.75rem);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.icon-btn.active {
    color: var(--accent);
    border-color: var(--border-active);
    background: var(--accent-dim);
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.clear-btn:hover {
    background: rgba(255, 71, 87, 0.25);
    border-color: rgba(255, 71, 87, 0.4);
    transform: scale(1.02);
}

.clear-btn:active {
    transform: scale(0.98);
}

/* ---------- Stats Bar ---------- */
.stats-bar {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.stat-pill.accent {
    border-color: var(--border-active);
    background: var(--accent-dim);
}

.stat-label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stat-pill.accent .stat-value {
    color: var(--accent);
}

/* ---------- Main Content ---------- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ---------- Section ---------- */
.menu-section {
    animation: section-fade-in 0.5s ease-out both;
}

.menu-section:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes section-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- ElevenLabs Combo Styles ---------- */
.subtle-section .section-title {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.subtle-section .section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a855f7;
    box-shadow: 0 0 8px #a855f7, 0 0 12px rgba(168, 85, 247, 0.4);
}

.subtle-section .section-header {
    margin-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: var(--space-md);
}

.combo-card {
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.4) 0%, rgba(15, 15, 15, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 4px 20px rgba(0, 0, 0, 0.4);
}

.combo-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at 50% 0%, rgba(168, 85, 247, 0.06), transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.combo-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

.combo-card:hover::after {
    opacity: 1;
}

.combo-card.active {
    border-color: rgba(168, 85, 247, 0.4);
    background: linear-gradient(180deg, rgba(40, 25, 60, 0.5) 0%, rgba(15, 12, 20, 0.7) 100%);
    box-shadow: 
        inset 0 1px 0 rgba(168, 85, 247, 0.2),
        0 0 20px rgba(168, 85, 247, 0.15);
}

.combo-card.active::after {
    background: radial-gradient(600px circle at 50% 0%, rgba(168, 85, 247, 0.15), transparent 50%);
    opacity: 1;
}

.combo-tag {
    position: absolute;
    top: 14px;
    left: var(--space-lg);
    padding: 3px 10px;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2;
}

.combo-card .card-top {
    margin-top: 24px;
}


.section-header {
    margin-bottom: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-icon {
    font-size: 1.2rem;
}

.section-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    padding: 3px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

.section-count.has-selection {
    color: var(--accent);
    border-color: var(--border-active);
    background: var(--accent-dim);
}

/* ---------- Menu Grid ---------- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

/* ---------- Menu Card ---------- */
.menu-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.menu-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.menu-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.menu-card:hover::before {
    opacity: 1;
}

.menu-card.active {
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
}

.menu-card.active::before {
    opacity: 1;
}

/* Active badge */
.menu-card .active-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-spring);
    box-shadow: 0 0 8px var(--accent-glow);
}

.menu-card.active .active-badge {
    opacity: 1;
    transform: scale(1);
    animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(255, 200, 55, 0.3); }
    50% { box-shadow: 0 0 12px rgba(255, 200, 55, 0.6); }
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-emoji {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-spring);
}

.card-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-spring);
}

.menu-card:hover .card-emoji,
.menu-card:hover .card-image {
    transform: scale(1.12) rotate(-5deg);
}

.card-name {
    font-family: var(--font-display);
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.card-price {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Quick-add hint */
.card-tap-hint {
    position: absolute;
    bottom: var(--space-md);
    right: var(--space-lg);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
    z-index: 1;
}

.menu-card:hover .card-tap-hint {
    opacity: 0.6;
}

.menu-card.active .card-tap-hint {
    opacity: 0 !important;
    display: none !important;
}

/* ---------- Quantity Controls ---------- */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 2;
}

.qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.qty-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-btn.minus:hover {
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--danger);
    background: var(--danger-dim);
}

.qty-btn.plus:hover {
    border-color: rgba(46, 213, 115, 0.3);
    color: var(--success);
    background: var(--success-dim);
}

.qty-display {
    min-width: 48px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-variant-numeric: tabular-nums;
    text-align: center;
    outline: none;
    padding: 0;
    -moz-appearance: textfield;
}

.qty-display::-webkit-outer-spin-button,
.qty-display::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-display.has-value {
    color: var(--accent);
    border-color: var(--border-active);
    background: var(--accent-dim);
}

.card-subtotal {
    margin-top: var(--space-sm);
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-5px);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
    min-height: 20px;
}

.card-subtotal.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-subtotal span {
    color: var(--text-accent);
    font-weight: 700;
}

/* ---------- Order Footer ---------- */
.order-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.88);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border-top: 1px solid var(--border-subtle);
    transform: translateY(100%);
    transition: transform var(--transition-spring);
}

.order-footer.visible {
    transform: translateY(0);
}

.order-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
}

.order-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.order-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.order-items-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.order-items-count span {
    color: var(--text-primary);
    font-weight: 700;
}

.receipt-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.receipt-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.order-total {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.total-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.total-amount {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    transition: transform var(--transition-spring);
}

.total-amount.bump {
    animation: total-bump 0.3s ease-out;
}

@keyframes total-bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.order-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal), margin var(--transition-normal);
}

.order-breakdown.has-items {
    max-height: 200px;
    margin-top: var(--space-md);
}

.breakdown-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    animation: chip-in 0.2s ease-out both;
}

@keyframes chip-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.breakdown-chip .chip-qty {
    color: var(--accent);
    font-weight: 700;
}

.breakdown-chip .chip-name {
    color: var(--text-primary);
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Receipt Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--space-md);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-spring);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-md);
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.modal-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.modal-order-num {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    color: var(--danger);
    border-color: rgba(255, 71, 87, 0.3);
    background: var(--danger-dim);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: var(--space-sm);
}

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

.receipt-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.receipt-item-emoji {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.receipt-item-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.receipt-item-details {
    min-width: 0;
}

.receipt-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-item-qty {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.receipt-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.receipt-empty {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.receipt-empty-emoji {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.modal-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-total span:first-child {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.modal-total-amount {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variant-numeric: tabular-nums;
}

.new-order-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--gradient-accent);
    color: #000;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.new-order-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 200, 55, 0.3);
}

.new-order-btn:active {
    transform: scale(0.97);
}

/* ---------- Tap Ripple Effect ---------- */
.menu-card .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 200, 55, 0.12);
    transform: scale(0);
    animation: ripple-anim 0.6s ease-out;
    pointer-events: none;
    z-index: 0;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---------- Shake animation (when hitting 0) ---------- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.shake {
    animation: shake 0.35s ease-out;
}

/* ---------- Quick-add pulse animation ---------- */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(255, 200, 55, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 200, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 200, 55, 0); }
}

.menu-card.pulse {
    animation: pulse-glow 0.4s ease-out;
}

/* ---------- Number pop animation ---------- */
@keyframes number-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.qty-display.pop {
    animation: number-pop 0.2s ease-out;
}

/* ---------- Float up animation for +1 indicator ---------- */
.float-indicator {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-display);
    animation: float-up 0.7s ease-out forwards;
}

.float-indicator.add {
    color: var(--success);
}

.float-indicator.remove {
    color: var(--danger);
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.7);
    }
}

/* ---------- Responsive ---------- */

/* Large tablets */
@media (max-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small tablets / large phones */
@media (max-width: 768px) {
    .header-content {
        padding: var(--space-sm) var(--space-sm);
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding: var(--space-md) var(--space-sm);
        gap: var(--space-lg);
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .menu-card {
        padding: var(--space-md);
    }

    .card-emoji {
        font-size: 2rem;
    }

    .total-amount {
        font-size: 1.4rem;
    }

    .order-footer-content {
        padding: var(--space-sm) var(--space-md);
    }

    .app {
        padding-bottom: 140px;
    }

    .receipt-btn span {
        display: none;
    }

    .stats-bar {
        gap: 6px;
    }

    .stat-pill {
        padding: 4px 10px;
        font-size: 0.72rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .menu-card {
        padding: var(--space-sm) var(--space-md);
    }

    .card-top {
        gap: 6px;
        margin-bottom: var(--space-sm);
    }

    .card-emoji {
        font-size: 1.6rem;
    }

    .card-name {
        font-size: 0.82rem;
    }

    .card-price {
        font-size: 0.88rem;
    }

    .qty-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .qty-display {
        min-width: 42px;
        height: 36px;
        font-size: 0.95rem;
    }

    .card-subtotal {
        font-size: 0.72rem;
    }

    .clear-btn-text {
        display: none;
    }

    .clear-btn {
        padding: var(--space-sm);
    }

    .logo-img {
        width: 36px;
        height: 36px;
    }

    .order-footer-content {
        padding: var(--space-sm);
    }

    .modal {
        border-radius: var(--radius-lg);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-md);
    }

    .card-tap-hint {
        display: none;
    }
}

/* Very small */
@media (max-width: 360px) {
    .menu-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .menu-card {
        padding: var(--space-sm);
    }

    .card-emoji {
        font-size: 1.4rem;
    }

    .card-name {
        font-size: 0.78rem;
    }

    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .qty-display {
        min-width: 36px;
        height: 32px;
        font-size: 0.85rem;
    }

    .stat-pill {
        padding: 3px 8px;
        font-size: 0.68rem;
    }

    .section-count {
        font-size: 0.65rem;
    }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
    .header-content {
        padding: 4px var(--space-sm);
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .main-content {
        padding: var(--space-sm);
        gap: var(--space-md);
    }

    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 6px;
    }

    .menu-card {
        padding: var(--space-sm);
    }

    .card-emoji {
        font-size: 1.5rem;
    }

    .app {
        padding-bottom: 100px;
    }
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Selection ---------- */
::selection {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ---------- Focus Visible ---------- */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* ---------- Credit Pill ---------- */
.credit-pill {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(22, 22, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.credit-pill:hover {
    color: var(--text-secondary);
    border-color: var(--border-hover);
    background: rgba(30, 30, 36, 0.92);
    box-shadow: 0 0 20px rgba(255, 200, 55, 0.08);
    transform: translateX(-50%) translateY(-2px);
}

.credit-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform var(--transition-spring);
    border: 1px solid var(--border-subtle);
}

.credit-pill:hover .credit-avatar {
    transform: rotate(-15deg) scale(1.15);
    border-color: var(--border-hover);
}

/* Easter egg activated state */
.credit-pill.easter-egg-active {
    border-color: transparent;
    background: linear-gradient(135deg, 
        rgba(255, 200, 55, 0.2) 0%, 
        rgba(255, 71, 87, 0.2) 25%,
        rgba(139, 92, 246, 0.2) 50%,
        rgba(46, 213, 115, 0.2) 75%,
        rgba(255, 200, 55, 0.2) 100%
    );
    background-size: 300% 300%;
    animation: credit-rainbow 3s ease infinite;
    box-shadow: 
        0 0 20px rgba(255, 200, 55, 0.15),
        0 0 40px rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    transform: translateX(-50%);
}

.credit-pill.easter-egg-active .credit-avatar {
    animation: credit-spin 1s ease-in-out infinite;
    border-color: var(--accent);
}

@keyframes credit-rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes credit-spin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(15deg) scale(1.3); }
    50% { transform: rotate(0deg) scale(1); }
    75% { transform: rotate(-15deg) scale(1.3); }
    100% { transform: rotate(0deg) scale(1); }
}

/* Hot dog rain overlay */
.hotdog-rain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.hotdog-rain-piece {
    position: absolute;
    top: -60px;
    font-size: 2rem;
    animation: hotdog-fall linear forwards;
    pointer-events: none;
}

@keyframes hotdog-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(540deg);
        opacity: 0;
    }
}

/* Hide credit pill when footer overlaps */
.order-footer.visible ~ .credit-pill {
    opacity: 0;
    pointer-events: none;
}
