:root {
    --primary: #e60000;
    --primary-dark: #b30000;
    --secondary: #ff9800;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --success: #10b981;
    --pending: #f59e0b;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

* { font-family: 'Tajawal', sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    padding-bottom: 80px;
}

.navbar-top {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    box-shadow: 0 2px 12px rgba(230,0,0,0.25);
    padding: 14px 0;
}

.navbar-top .navbar-brand {
    color: #fff !important;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.navbar-top .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 8px 14px !important;
    border-radius: 20px;
    transition: 0.2s;
}

.navbar-top .nav-link:hover, .navbar-top .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
}

.search-bar {
    background: #fff;
    border: none;
    border-radius: 30px;
    padding: 10px 18px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    margin: 12px auto;
    display: flex;
    align-items: center;
}

.search-bar input {
    border: none;
    flex: 1;
    outline: none;
    background: transparent;
    margin-right: 10px;
}

.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    transition: 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-outline-light { border-radius: 12px; }

.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 0;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 12px;
}

.hero h2 { font-weight: 500; font-size: 1.4rem; margin-bottom: 0; }

.card {
    background: var(--card);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: 0.25s;
    cursor: pointer;
    overflow: hidden;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.card img {
    height: 170px;
    width: 100%;
    object-fit: cover;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    min-height: 140px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    transition: 0.2s;
}

.category-card:hover { background: #fff0f0; transform: translateY(-3px); }

.category-card i { font-size: 2.2rem; color: var(--primary); margin-bottom: 12px; }

.product-card {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: 0.2s;
    border: none;
    min-height: 90px;
}

.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.product-card .product-img {
    height: 65px;
    width: 65px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f5f7fa;
}

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

.product-name { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.product-desc { font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; line-height: 1.25; }
.product-price { font-size: 0.9rem; font-weight: 800; color: var(--primary); margin: 0; }

.btn-add {
    height: 34px;
    width: auto;
    min-width: 70px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    gap: 4px;
    transition: 0.2s;
}
.btn-add:hover { background: var(--primary-dark); transform: scale(1.03); }

.product-search {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.product-search input {
    border: none;
    flex: 1;
    outline: none;
    background: transparent;
    margin-right: 10px;
}

.category-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
}

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

.category-chip {
    white-space: nowrap;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--text);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}

.category-chip.active,
.category-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.badge-open { background: var(--success) !important; }
.badge-closed { background: var(--muted) !important; }

.status-pending { color: var(--pending); }
.status-delivered { color: var(--success); }
.status-cancelled { color: #ef4444; }

.auth-box {
    max-width: 440px;
    margin: 40px auto;
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 32px 24px;
}

@media (max-width: 576px) {
    .auth-box {
        margin: 20px 16px;
        padding: 24px 18px;
    }
}

.form-control {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(230,0,0,0.1); }

.offcanvas {
    border-radius: 24px 0 0 24px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1030;
}

.bottom-nav a {
    color: var(--muted);
    text-decoration: none;
    text-align: center;
    font-size: 0.78rem;
    flex: 1;
}

.bottom-nav a i { display: block; font-size: 1.3rem; margin-bottom: 4px; }

.bottom-nav a.active { color: var(--primary); font-weight: 700; }

.cart-badge {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.68rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: 4px;
    line-height: 1;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

.toast-msg {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
}

.page-title {
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text);
}

.section-title {
    font-weight: 700;
    margin: 28px 0 16px;
    color: var(--text);
}

.order-card {
    border-right: 4px solid var(--primary);
    margin-bottom: 16px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.order-card:hover { border-right-color: var(--secondary); }
#map { height: 260px; border-radius: var(--radius); z-index: 1; }

@media (min-width: 992px) {
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
}
