:root {
    /* Antigravity Palette */
    --primary-color: #FF7043;
    /* Vibrant Orange for high conversion */
    --primary-light: #FFAB91;
    --accent-color: #00BFA5;
    /* Mint Green for freshness */
    --bg-color: #F8F9FA;
    /* Ultra light gray */
    --surface-color: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #757575;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --warning-color: #FFC107;

    /* Spacing & Layout */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Shadows (Antigravity Lift) */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Typography Utility */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 {
    font-size: 1.5rem;
}

h2 {
    font-size: 1.25rem;
}

p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.text-primary {
    color: var(--primary-color);
}

.text-bold {
    font-weight: 600;
}

/* Layout Structure */
#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 480px;
    /* Mobile constraint for desktop testing */
    margin: 0 auto;
    background: var(--surface-color);
    position: relative;
    box-shadow: var(--shadow-lg);
}

header {
    padding: var(--spacing-md);
    background: var(--surface-color);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    padding-bottom: 100px;
    /* Space for bottom nav & floating elements */
    position: relative;
}

/* Components */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
    cursor: pointer;
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 0px var(--primary-color);
    transition: box-shadow 0.2s;
    pointer-events: none;
}

.card:active::after {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* Button Interactions */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #FF5722);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.5);
}

.btn-primary:active {
    transform: scale(0.95) translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 12px;
}

.btn-pulse {
    animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 112, 67, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 112, 67, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 112, 67, 0);
    }
}

/* Inputs */
.input-group {
    margin-bottom: var(--spacing-md);
}

input {
    width: 100%;
    padding: 14px;
    border: 2px solid #EEE;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-color);
}

/* Carousel */
.carousel {
    display: flex;
    overflow-x: auto;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    min-width: 140px;
    flex-shrink: 0;
}

.product-img {
    width: 100%;
    height: 100px;
    background: #EEE;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    object-fit: cover;
}

/* Bottom Nav */
.bottom-nav {
    position: absolute;
    bottom: 0px;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
    /* Safe area */
    z-index: 20;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #9E9E9E;
    font-size: 0.7rem;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 16px;
}

.nav-item .nav-icon {
    font-size: 1.6rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item:active .nav-icon {
    transform: scale(0.8);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(255, 112, 67, 0.1);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
}

/* Merchant Dashboard Specifics */
.dash-metric {
    text-align: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- NEW FEATURES STYLES --- */

/* Live Status Pill */
.status-pill {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning-color);
    animation: pulse 1.5s infinite;
}

/* Delivery Radar View */
.radar-container {
    height: 250px;
    background: #263238;
    /* Dark Map BG Theme */
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    margin-bottom: var(--spacing-md);
}

.radar-pulse {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(0, 191, 165, 0.6);
    border-radius: 50%;
    animation: radar-expanded 3s infinite;
}

@keyframes radar-expanded {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(15);
        opacity: 0;
    }
}

.delivery-card-stack {
    position: relative;
    height: 200px;
}

.swipable-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    cursor: grab;
    z-index: 2;
    transition: transform 0.3s;
}

.swipable-card.swiping {
    transition: none;
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
    color: white;
}

/* Confetti Container */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Utilities */
.hidden {
    display: none !important;
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Global Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.view-content {
    animation: fadeIn 0.3s ease-out;
}