:root {
    --brand-primary: #254055;
    --brand-fill: #254055;
    --brand-accent: #254055;
    --on-brand: #ffffff;
    --navy: #254055;
    --bg: #f6f7f9;
    --text: #111827;
    --muted: #6b7280;
    --line: #e6ebf0;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

button, input, select, textarea {
    font-family: inherit;
}

#app {
    min-height: 100vh;
}

.store-shell {
    min-height: 100vh;
    background: var(--bg);
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand__logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
}

.brand__name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.panel h1, .panel h2, .panel label {
    color: var(--text);
}

.cart-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-fill);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
}

.cart-chip__count {
    background: #fff;
    color: var(--brand-fill);
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
    font-size: 0.85rem;
}

.store-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 16px 48px;
}

.menu-tools {
    margin: 0 0 12px;
}

.menu-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 4px 12px 4px 10px;
    box-shadow: 0 6px 16px rgba(37, 64, 87, 0.05);
}

.menu-search__ico {
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
}

.menu-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 1rem;
    color: var(--text);
}

.menu-search input::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.chip {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
}

.chip--on {
    background: var(--brand-fill);
    color: #fff;
    border-color: var(--brand-fill);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.card {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.card__media {
    aspect-ratio: 1;
    background: #f7f7f7;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__body {
    padding: 10px 12px 12px;
}

.card__body h2 {
    font-size: 0.95rem;
    margin: 0 0 6px;
    color: var(--text);
}

.price {
    color: var(--text);
    font-weight: 700;
    margin: 0 0 8px;
}

.price--sale {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.price__old {
    color: var(--muted);
    font-weight: 500;
    text-decoration: line-through;
    font-size: 0.85rem;
}

.sale-badge {
    display: inline-flex;
    align-items: center;
    background: #e11d48;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.sale-badge--header {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.btn {
    background: var(--brand-fill);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    text-decoration: none;
}

a.btn,
a.seg__btn {
    text-decoration: none;
    color: #fff;
}

.tile-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.qty-step {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
}

.qty-val {
    min-width: 36px;
    text-align: center;
    font-weight: 800;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 6px;
    background: #fff;
}

.note--card {
    margin-top: 8px;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.panel__head h1 { margin: 0; }

.panel__head .seg__btn.btn-menu {
    width: auto;
    min-width: 140px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.line__info { flex: 1; min-width: 0; color: var(--text); }

.line__mod {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
}

.line__qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.row-del {
    width: 32px;
    height: 32px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff5f5;
    color: #dc2626;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
}

.btn--block { width: 100%; margin-top: 12px; }
.btn--ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }

.checkout {
    display: grid;
    gap: 16px;
}

@media (min-width: 900px) {
    .checkout { grid-template-columns: 1.2fr 0.9fr; align-items: start; }
}

.panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #fff;
}

.panel h1, .panel h2 { margin-top: 0; }

.panel label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

.panel input, .panel textarea, .panel select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
}

.line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.note { margin-top: 8px; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-sizing: border-box; }

.qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
}

.totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    font-size: 1.1rem;
    color: var(--text);
}

.totals__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button,
.seg__btn {
    min-height: 46px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 12px;
    padding: 10px 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.05rem;
}
.seg button.seg--on,
.seg__btn.seg--on {
    background: var(--brand-fill) !important;
    color: #fff !important;
    border-color: var(--brand-fill) !important;
}

.muted { color: var(--muted); opacity: 0.9; }
.line--bad { background: #fff5f5; border-radius: 12px; padding: 12px 8px; }
.line__warn {
    margin: 6px 0 0;
    color: #b00020;
    font-weight: 800;
    font-size: 0.86rem;
}
.error { color: #b00020; font-weight: 600; }
.link-danger { border: 0; background: transparent; color: #b00020; cursor: pointer; width: auto !important; }

.state-card {
    max-width: 560px;
    margin: 12vh auto;
    text-align: center;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.empty-state {
    max-width: 440px;
    margin: 8vh auto;
    text-align: center;
    padding: 40px 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(37, 64, 87, 0.07);
}

.empty-state img {
    width: 96px;
    height: auto;
    margin-bottom: 16px;
}

.empty-state__mark {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    overflow: hidden;
}

.empty-state__mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
}

.ok-mark {
    width: 86px;
    height: 86px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 2.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.28);
}

.empty-state--ok h1 { color: #15803d; }

@media (max-width: 720px) {
    .store-header { padding: 10px 12px; }
    .brand__name { font-size: 0.95rem; }
    .cart-chip { padding: 8px 12px; font-size: 0.9rem; }
    .store-main { padding: 12px 10px 36px; }
    .menu-search input { font-size: 0.95rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
    .checkout { grid-template-columns: 1fr; }
    .panel { padding: 12px; }
    .si-fld, .line { flex-wrap: wrap; }
}

.empty-state h1 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
    font-size: 1.02rem;
}

.boot-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #fff;
    color: var(--navy);
    font-family: "Tajawal", sans-serif;
}

.boot-screen img {
    width: 104px;
    height: auto;
}

.boot-screen p {
    margin: 0;
    font-weight: 700;
}

.state-card--wide h1 { margin-top: 0; }
.status-line { font-size: 1.05rem; }

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
