:root {
    --brand-primary: #1e3a5f;
    --brand-secondary: #c9a227;
    --brand-bg: #f4f6f9;
}

* { font-family: 'Vazirmatn', 'Tahoma', sans-serif; }
.bi, [class^="bi-"], [class*=" bi-"] { font-family: "bootstrap-icons" !important; }

body { background-color: var(--brand-bg); color: #22293b; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
a { color: var(--brand-primary); }

/* ---------- هدر ثابت ---------- */
.site-sticky-header { position: sticky; top: 0; z-index: 1030; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.site-topbar { background: linear-gradient(90deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 70%, #000 10%)); color: #fff; }
.site-topbar-logo { height: 34px; width: auto; border-radius: 8px; background: #fff; padding: 2px; }
.site-topbar-icon { font-size: 1.6rem; color: var(--brand-secondary); }
.site-topbar-title { font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.site-topbar-subtitle { font-size: .78rem; opacity: .85; }
.site-topbar-user { font-size: .85rem; color: #fff !important; opacity: .9; cursor: pointer; }
.site-topbar-user:hover { opacity: 1; }
.site-topbar-user.dropdown-toggle::after { margin-right: .3rem; margin-left: 0; vertical-align: middle; }

.navbar { background-color: color-mix(in srgb, var(--brand-primary) 88%, #000 12%) !important; padding: .4rem 0; }
.navbar .nav-link { color: rgba(255,255,255,.85) !important; font-size: .88rem; padding: .4rem .65rem; border-radius: 8px; transition: background .15s; }
.navbar .nav-link:hover, .navbar .nav-link.active { background: rgba(255,255,255,.14); color: #fff !important; }
.navbar .dropdown-toggle::after { margin-right: .3rem; margin-left: 0; }
.navbar .dropdown-menu, .site-topbar .dropdown-menu { border-radius: 12px; border: none; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: .5rem; min-width: 220px; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; }

/* ---------- عناصر عمومی ---------- */
.btn-primary { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-primary:hover { filter: brightness(.9); background-color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary { color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary:hover { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-control, .form-select { border-radius: 10px; border-color: #dfe3ea; }
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand-primary) 20%, transparent); }
.form-label { font-weight: 600; font-size: .88rem; }
.breadcrumb-item a { text-decoration: none; }

.hero-gradient {
    background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, #2c5282 40%));
    color: #fff; border-radius: 20px;
}
.hero-banner {
    background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 60%, #2c5282 40%));
    background-size: cover; background-position: center; border-radius: 20px;
}

.app-card { border: none; border-radius: 16px; box-shadow: 0 1px 8px rgba(0,0,0,.06); transition: box-shadow .18s, transform .18s; background: #fff; }
a:hover > .app-card { box-shadow: 0 6px 20px rgba(0,0,0,.10); transform: translateY(-2px); }
.badge-status { font-size: .78rem; padding: .45em .85em; border-radius: 20px; font-weight: 600; }

.org-section-card { border: none; border-radius: 20px; box-shadow: 0 4px 18px rgba(0,0,0,.07); transition: transform .2s, box-shadow .2s; background: #fff; }
.org-section-card:hover { transform: translateY(-6px); box-shadow: 0 14px 32px rgba(0,0,0,.12); }
.org-section-icon {
    width: 76px; height: 76px; margin: 0 auto; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.org-section-image { width: 100%; max-height: 140px; object-fit: cover; border-radius: 14px; }

.home-slide { height: 380px; background-size: cover; background-position: center; display: flex; align-items: center; padding: 0 3rem;
    background-image: linear-gradient(90deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 55%, #2c5282 45%)); }
.home-slide-caption { color: #fff; max-width: 560px; }
.home-slide-caption h2 { font-weight: 700; margin-bottom: .75rem; }
@media (max-width: 768px) { .home-slide { height: 260px; padding: 0 1.25rem; } }

.site-footer { background: #fff; border-top: 1px solid #e9ecef; color: #8a94a6; margin-top: 3rem; }

/* ---------- صفحات احراز هویت ---------- */
.auth-page { min-height: calc(100vh - 320px); display: flex; align-items: center; padding: 2rem 0; }
.auth-card { border: none; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.08); width: 100%; background: #fff; }
.auth-logo-icon { font-size: 2.6rem; color: var(--brand-primary); display: inline-block; }

/* ---------- پنل مدیریت ---------- */
.admin-shell { display: flex; min-height: 100vh; width: 100%; }
.admin-sidebar { width: 260px; flex-shrink: 0; background: #14273f; color: #fff; padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-brand { color: #fff; font-weight: 700; font-size: 1.1rem; display: block; padding-bottom: .75rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-sidebar .nav-link { color: rgba(255,255,255,.8); border-radius: 10px; padding: .55rem .75rem; font-size: .9rem; }
.admin-sidebar .nav-link i { margin-left: .5rem; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .5; margin: .9rem .75rem .25rem; }
.admin-main { flex: 1; min-width: 0; background: var(--brand-bg); }
.admin-menu-toggle { position: fixed; top: 10px; right: 10px; z-index: 1040; }
@media (max-width: 767.98px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; padding-top: 3.5rem; }
}
.stat-card { border: none; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.06); background: #fff; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.table > :not(caption) > * > * { vertical-align: middle; }

#blazor-error-ui {
    background: #ffffe0; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; left: .75rem; top: .5rem; }
.validation-message { color: #dc3545; font-size: .82rem; }

/* ---------- جستجو و سبد خرید در نوار بالا ---------- */
.navbar-search-input { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.navbar-search-input::placeholder { color: rgba(255,255,255,.65); }
.navbar-search-input:focus { background: #fff; color: #22293b; box-shadow: none; border-color: var(--brand-secondary); }
.cart-btn { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: .35rem; }
.payment-method-btn { background: #fff; border: 2px solid #e5e9f0; text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.payment-method-btn:hover { border-color: var(--brand-primary); box-shadow: 0 8px 22px rgba(0,0,0,.08); transform: translateY(-2px); }
.star-rating { color: var(--brand-secondary); }
.product-cover { height: 200px; object-fit: cover; width: 100%; }
