/* 02-shell.css: header, nav, footer, mobile tabbar, auth pages, hero, reconnect modal. */

/* ---------- header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 64px;
}

.logo {
    font-size: 1.3rem;
    color: var(--brand-900);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.logo:hover {
    text-decoration: none;
    color: var(--brand-900);
}

.logo strong {
    font-weight: 800;
    color: var(--brand-600);
}

.header-nav {
    display: none;
    gap: 20px;
    flex: 1;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
}

.nav-link:hover {
    color: var(--brand-600);
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    color: var(--brand-700);
    font-size: 1.25rem;
}

.header-icon:hover {
    background: var(--brand-50);
    text-decoration: none;
}

@media (min-width: 900px) {
    .header-nav {
        display: flex;
    }
}

.header-phone {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: var(--brand-700);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.header-phone:hover {
    background: var(--brand-50);
    text-decoration: none;
}

@media (min-width: 1100px) {
    .header-phone {
        display: inline-flex;
    }
}

/* ---------- category nav bar (under the header) ---------- */

.category-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: none;
    position: relative;
}

.category-nav-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav-inner::-webkit-scrollbar {
    display: none;
}

.category-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.category-nav-link:hover {
    color: var(--brand-600);
    border-bottom-color: var(--brand-500);
    text-decoration: none;
}

/* Overflow affordance: right-edge fade + a scroll arrow, shown only while the
   row actually overflows (the .has-overflow class is set from a resize check). */
.category-nav-fade {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 1px;
    width: 72px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, var(--bg-card) 78%);
}

.category-nav-arrow {
    display: none;
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--brand-600);
    cursor: pointer;
    box-shadow: var(--shadow-card);
}

.category-nav.has-overflow .category-nav-fade {
    display: block;
}

.category-nav.has-overflow .category-nav-arrow {
    display: inline-flex;
}

@media (min-width: 900px) {
    .category-nav {
        display: block;
    }
}

/* ---------- header search (desktop) ---------- */

.header-search {
    display: none;
    flex: 1;
    max-width: 320px;
    position: relative;
}

.header-search input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search .header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

@media (min-width: 1100px) {
    .header-search {
        display: block;
    }
}

/* ---------- main + hero ---------- */

.site-main {
    min-height: 60vh;
    padding-bottom: 72px; /* clear the mobile tabbar */
}

.hero {
    background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
    padding: 64px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.1rem;
    max-width: 760px;
    margin: 0 auto 16px;
}

.hero-sub {
    max-width: 640px;
    margin: 0 auto 28px;
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 2.6rem;
    }
}

/* ---------- footer ---------- */

.site-footer {
    background: var(--brand-900);
    color: #D6EAF8;
    padding: 32px 0;
    margin-top: 48px;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    justify-content: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(214, 234, 248, 0.25);
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #EAF4FB;
}

.trust-item i {
    color: var(--brand-200);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
    padding: 28px 0 20px;
    border-bottom: 1px solid rgba(214, 234, 248, 0.25);
}

.footer-heading {
    color: #FFFFFF;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    color: #D6EAF8;
    font-size: 0.88rem;
}

.footer-links a:hover {
    color: #FFFFFF;
}

.footer-contact li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #D6EAF8;
    font-size: 0.88rem;
}

.footer-contact i {
    color: var(--brand-200);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
}

.footer-brand {
    font-size: 1.1rem;
    color: #FFFFFF;
}

.footer-brand strong {
    color: var(--brand-200);
    font-weight: 800;
}

.footer-note {
    font-size: 0.85rem;
    color: var(--brand-200);
}

/* ---------- mobile bottom tabbar ---------- */

.mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
}

.tab-item i {
    font-size: 1.2rem;
}

.tab-item:hover {
    color: var(--brand-600);
    text-decoration: none;
}

@media (min-width: 900px) {
    .mobile-tabbar {
        display: none;
    }

    .site-main {
        padding-bottom: 0;
    }
}

/* ---------- auth pages ---------- */

.auth-page {
    display: flex;
    justify-content: center;
    padding: 48px var(--section-px);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.auth-inline-link {
    margin-left: auto;
    font-size: 0.9rem;
}

/* ---------- admin shell skeleton ---------- */

.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-logo {
    padding: 0 8px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.admin-nav-link:hover {
    background: var(--brand-50);
    color: var(--brand-700);
    text-decoration: none;
}

.admin-content-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 0 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.dashboard-title {
    font-weight: 700;
    color: var(--brand-900);
}

.dashboard-content {
    padding: 24px;
}

@media (max-width: 899px) {
    .admin-sidebar {
        width: 72px;
    }

    .admin-nav-link span,
    .admin-logo {
        display: none;
    }
}

/* ---------- Blazor reconnect modal (custom, replaces the default bar) ---------- */

#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.reconnect-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 60, 93, 0.55);
    backdrop-filter: blur(2px);
}

.reconnect-card {
    position: relative;
    max-width: 420px;
    margin: 18vh auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 32px;
    text-align: center;
}

.reconnect-logo {
    font-size: 1.3rem;
    color: var(--brand-900);
    margin-bottom: 16px;
}

.reconnect-logo strong {
    font-weight: 800;
    color: var(--brand-600);
}

.reconnect-title {
    margin-bottom: 8px;
}

.reconnect-message,
.reconnect-sub {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.reconnect-rejected-msg {
    display: none;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

/* ---------- store announcement banner (SystemSettings-driven) ---------- */

.announcement-banner {
    background: var(--brand-900);
    color: var(--text-on-brand);
    font-size: 0.88rem;
    text-align: center;
    padding: 8px var(--section-px);
}
