:root {
    --bg: #0a1222;
    --surface: #101b34;
    --surface-2: #131f3d;
    --card: #17264a;
    --accent-cyan: #28c7ff;
    --accent-blue: #3a6bff;
    --accent-green: #8eea2f;
    --accent-lime: #c3f91f;
    --accent-orange: #ff8a00;
    --accent-yellow: #ffd650;
    --text: #ecf4ff;
    --muted: #b2c1de;
    --danger: #ff5c7a;
    --success: #29e38f;
    --shadow: 0 20px 45px rgba(5, 9, 20, 0.45);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --glow: 0 0 25px rgba(40, 199, 255, 0.18);
}

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

body {
    font-family: 'Sora', sans-serif;
    background: radial-gradient(1200px 900px at 10% -10%, rgba(58, 107, 255, 0.2), transparent),
                radial-gradient(1000px 700px at 90% 10%, rgba(142, 234, 47, 0.18), transparent),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.page-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(800px 600px at 30% 20%, rgba(255, 138, 0, 0.08), transparent),
                radial-gradient(700px 500px at 80% 70%, rgba(40, 199, 255, 0.08), transparent);
    z-index: -1;
}

#app {
    padding: 30px 6vw 80px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 26px;
    background: rgba(16, 27, 52, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    display: grid;
    place-items: center;
    box-shadow: var(--glow);
}

.logo-icon {
    font-size: 1.4rem;
}

.brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.brand-sub {
    color: var(--muted);
    font-size: 0.8rem;
}

.search-container {
    flex: 1;
    max-width: 460px;
    display: flex;
    background: var(--surface);
    border-radius: 999px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 10px 16px;
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cart-btn {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-count {
    background: var(--accent-orange);
    color: #1b0f00;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
}

.hero {
    margin: 40px 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    align-items: center;
}

.hero-content h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 3vw, 3rem);
    margin: 16px 0;
}

.hero-content p {
    color: var(--muted);
    line-height: 1.6;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(142, 234, 47, 0.15);
    border-radius: 999px;
    color: var(--accent-green);
    font-weight: 600;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    color: #041220;
    padding: 12px 20px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--glow);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 14px;
    cursor: pointer;
}

.hero-kpi {
    display: grid;
    gap: 16px;
}

.kpi-card {
    background: var(--surface-2);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.kpi-title {
    color: var(--muted);
    font-size: 0.85rem;
}

.kpi-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    margin: 8px 0;
}

.kpi-trend {
    color: var(--accent-green);
    font-weight: 600;
}

.top-categories {
    margin: 40px 0 20px;
}

.top-categories h2 {
    margin-bottom: 14px;
}

.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.category-chip {
    padding: 10px 14px;
    background: var(--surface);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    white-space: nowrap;
}

.category-chip.active {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    color: #06111f;
    font-weight: 700;
}

.main-content {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin-top: 20px;
}

.categories-sidebar {
    background: var(--surface-2);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: fit-content;
}

.categories-sidebar h3 {
    margin-bottom: 6px;
}

.categories-sidebar p {
    color: var(--muted);
    font-size: 0.85rem;
}

#categoryList {
    list-style: none;
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

#categoryList li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
}

#categoryList li.active {
    background: rgba(40, 199, 255, 0.18);
    border-color: rgba(40, 199, 255, 0.4);
}

.sidebar-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    color: #2b1500;
    font-weight: 700;
    cursor: pointer;
}

.products-section {
    display: grid;
    gap: 26px;
}

.section-header h2 {
    margin-bottom: 6px;
}

.section-header p {
    color: var(--muted);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(40, 199, 255, 0.2), rgba(142, 234, 47, 0.2), rgba(255, 138, 0, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.product-image {
    height: 140px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.product-info {
    position: relative;
    z-index: 1;
}

.product-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(40, 199, 255, 0.15);
    color: var(--accent-cyan);
    font-weight: 600;
}

.product-name {
    margin: 10px 0 6px;
    font-size: 1rem;
}

.product-description {
    color: var(--muted);
    font-size: 0.85rem;
    min-height: 38px;
}

.product-footer {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.add-to-cart {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--surface-2);
    padding: 24px;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow);
}

.modal-large {
    max-width: 860px;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 1.6rem;
    cursor: pointer;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid transparent;
    color: var(--text);
    cursor: pointer;
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #041220;
    font-weight: 700;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(7, 14, 28, 0.6);
    color: var(--text);
}

.upload-section {
    display: grid;
    gap: 8px;
}

.image-preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    display: none;
}

.btn-upload {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.checkout-section {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.address-input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(7, 14, 28, 0.6);
    color: var(--text);
}

.payment-methods {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.payment-option {
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(7, 14, 28, 0.6);
    padding: 8px 10px;
    border-radius: 10px;
}

.btn-checkout {
    width: 100%;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.qty-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text);
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
}

.floating-action {
    position: fixed;
    right: 30px;
    padding: 12px 16px;
    border-radius: 999px;
    border: none;
    color: #041220;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.driver-toggle {
    bottom: 100px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
}

.vendor-toggle {
    bottom: 40px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-lime));
}

.businesses-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.business-item {
    background: var(--surface);
    padding: 14px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.business-item .icon {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.driver-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.stat-card {
    background: var(--surface);
    padding: 14px;
    border-radius: 12px;
    text-align: center;
}

.delivery-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent-green);
}

.delivery-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
}

@media (max-width: 960px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .categories-sidebar {
        order: 2;
    }
}

@media (max-width: 600px) {
    #app {
        padding: 20px;
    }

    .search-container {
        max-width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}

.user-info {
    color: var(--text);
    font-weight: 600;
    margin-right: 10px;
}

.product-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.product-detail-image {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    height: 260px;
    display: grid;
    place-items: center;
    font-size: 3rem;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.product-detail-info h2 {
    margin-bottom: 10px;
}

.product-detail-info .price {
    font-size: 1.6rem;
    color: var(--accent-yellow);
    margin: 12px 0;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 16px;
}

.quantity-selector button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.vendor-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 10px;
}

.vendor-product-item img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
}

.vendor-map {
    width: 100%;
    height: 220px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 14, 28, 0.6);
}

.map-hint {
    color: var(--muted);
    font-size: 0.8rem;
}


.modal-content.modal-auth {
    max-width: 620px;
}

#addProductModal .modal-content {
    max-width: 720px;
}

#addProductModal .form-actions {
    justify-content: space-between;
    flex-wrap: wrap;
}

#addProductModal .form-actions button {
    min-width: 140px;
}


