/* Shared route-aware shells. Business capabilities remain controlled by existing Razor authorization. */
.header {
  padding: var(--sb-space-3) 0 0;
  border-bottom: 1px solid var(--sb-border);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 4px 18px rgb(6 29 92 / 6%);
}

.header-shell {
  min-height: 56px;
  gap: var(--sb-space-3);
}

.header-logo {
  flex: 0 0 auto;
}

.header-logo-image {
  max-height: 44px;
  width: auto;
}

.header-search {
  display: flex;
  flex: 1 1 520px;
  max-width: 680px;
  overflow: hidden;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-control);
  background: var(--sb-surface);
  box-shadow: inset 0 0 0 1px transparent;
}

.header-search:focus-within {
  border-color: var(--sb-blue);
  box-shadow: var(--sb-focus-ring);
}

.header-search-input {
  min-width: 0;
  border: 0;
  box-shadow: none !important;
}

.header-search-submit {
  min-width: var(--sb-control-height);
  border: 0;
  border-radius: 0;
  background: var(--sb-blue);
  color: var(--sb-surface);
}

.header-search-submit:hover,
.header-search-submit:focus-visible {
  background: var(--sb-blue-hover);
  color: var(--sb-surface);
}

.header-buy-button {
  color: var(--sb-navy);
  border-color: var(--sb-border);
  background: var(--sb-surface);
}

.header-sell-button {
  border-color: var(--sb-green);
  background: var(--sb-green);
  color: var(--sb-surface);
}

.header-sell-button:hover,
.header-sell-button:focus-visible {
  border-color: var(--sb-green-hover);
  background: var(--sb-green-hover);
  color: var(--sb-surface);
}

.header-secondary-nav {
  margin-top: var(--sb-space-3);
  padding-block: var(--sb-space-2);
  border-top: 1px solid var(--sb-border);
  gap: var(--sb-space-1);
}

.header-secondary-nav .nav-link {
  min-height: 40px;
  padding: var(--sb-space-2) var(--sb-space-3) !important;
  border-radius: var(--sb-radius-control);
  color: var(--sb-text) !important;
  font-size: var(--sb-size-sm);
}

.header-secondary-nav .nav-link[aria-current="page"] {
  color: var(--sb-blue) !important;
  background: var(--sb-surface-blue);
}

.mobile-browse-menu {
  display: none;
}

.workspace-shell {
  align-items: start;
}

.admin-workspace-shell .workspace-sidebar {
  top: 8.5rem;
}

.admin-mobile-toolbar,
.admin-drawer-header,
.admin-drawer-backdrop {
  display: none;
}

.admin-workspace-shell .workspace-sidebar-card {
  border-color: rgb(255 255 255 / 10%);
  color: var(--sb-surface);
  background: var(--sb-navy);
  box-shadow: var(--sb-shadow-card);
}

.admin-workspace-shell .workspace-sidebar-card h2,
.admin-workspace-shell .workspace-sidebar-card p,
.admin-workspace-shell .workspace-sidebar-card .eyebrow {
  color: inherit;
}

.admin-workspace-shell .workspace-link {
  color: rgb(255 255 255 / 82%);
}

.admin-workspace-shell .workspace-link:hover,
.admin-workspace-shell .workspace-link:focus-visible,
.admin-workspace-shell .workspace-link.is-active {
  color: var(--sb-surface);
  background: rgb(255 255 255 / 12%);
}

.mobile-bottom-nav {
  border-top: 1px solid var(--sb-border);
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 -8px 24px rgb(6 29 92 / 8%);
}

.mobile-bottom-link {
  min-height: 48px;
  color: var(--sb-text-muted);
}

.mobile-bottom-link.is-active {
  color: var(--sb-blue);
}

.mobile-bottom-link-primary {
  color: var(--sb-green);
}

@media (max-width: 991.98px) {
  .admin-mobile-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sb-space-3);
    margin-bottom: var(--sb-space-4);
    padding: var(--sb-space-3) var(--sb-space-4);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-card);
    background: var(--sb-surface);
    box-shadow: var(--sb-shadow-card);
  }

  .admin-mobile-toolbar strong,
  .admin-mobile-toolbar span {
    display: block;
  }

  .admin-drawer-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--sb-space-2);
  }

  .admin-workspace-shell {
    display: block;
  }

  .admin-workspace-shell .workspace-sidebar {
    position: fixed;
    z-index: 1055;
    inset: 0 auto 0 0;
    display: block;
    width: min(88vw, 22rem);
    padding: var(--sb-space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--sb-navy);
    box-shadow: 18px 0 42px rgb(6 29 92 / 26%);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .admin-workspace-shell .workspace-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sb-space-3);
    margin-bottom: var(--sb-space-3);
    color: var(--sb-surface);
  }

  .admin-drawer-header .btn-close {
    filter: invert(1);
  }

  .admin-drawer-backdrop.is-visible {
    position: fixed;
    z-index: 1050;
    inset: 0;
    display: block;
    background: rgb(6 29 92 / 58%);
  }

  body.admin-drawer-open {
    overflow: hidden;
  }

  .admin-workspace-shell .workspace-sidebar-card {
    color: var(--sb-surface);
    border-color: rgb(255 255 255 / 10%);
    background: var(--sb-navy);
  }

  .admin-workspace-shell .workspace-link {
    min-height: 44px;
    color: rgb(255 255 255 / 82%);
  }

  .admin-workspace-shell .workspace-link:hover,
  .admin-workspace-shell .workspace-link:focus-visible,
  .admin-workspace-shell .workspace-link.is-active {
    color: var(--sb-surface);
    background: rgb(255 255 255 / 12%);
  }

  .admin-workspace-bottom-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-workspace-shell .workspace-sidebar {
    transition: none;
  }
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }

  .header {
    padding: var(--sb-space-2) 0;
  }

  .header-shell {
    min-height: 44px;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--sb-space-2);
  }

  .header-logo-image {
    width: 88px;
    height: auto;
    max-height: 40px;
  }

  .header-search,
  .header-buy-button,
  .header-sell-button {
    display: none;
  }

  .header-user-menu {
    width: auto;
    min-width: 0;
    margin-left: auto;
  }

  .site-account-links {
    width: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--sb-space-1);
  }

  .site-account-links .site-account-name {
    display: none;
  }

  .site-account-links .nav-item,
  .site-account-links .nav-item form {
    display: flex;
    align-items: center;
    margin: 0;
  }

  .site-account-links .nav-link,
  .site-account-links .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: var(--sb-space-2) var(--sb-space-3) !important;
    border: 0;
    line-height: 1;
    white-space: nowrap;
    font-size: var(--sb-size-sm);
  }

  .mobile-search-bar {
    margin-top: var(--sb-space-2);
  }

  .mobile-search-shell {
    overflow: hidden;
    min-height: 46px;
    gap: 0;
    padding: 0;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-control);
    background: var(--sb-surface);
    box-shadow: none;
  }

  .mobile-search-input {
    border: 0;
    box-shadow: none !important;
  }

  .mobile-search-button {
    width: auto;
    min-width: 64px;
    min-height: 46px;
    padding-inline: var(--sb-space-3);
    border: 0;
    border-radius: 0;
    background: var(--sb-blue);
  }

  .header-secondary-nav {
    display: none;
  }

  .mobile-browse-menu {
    display: block;
    overflow: hidden;
    margin-top: var(--sb-space-2);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-control);
    background: var(--sb-surface);
    box-shadow: 0 8px 22px rgb(6 29 92 / 6%);
  }

  .mobile-browse-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: var(--sb-space-2);
    align-items: center;
    min-height: 64px;
    padding: var(--sb-space-2) var(--sb-space-3);
    color: var(--sb-text);
    cursor: pointer;
    list-style: none;
  }

  .mobile-browse-summary::-webkit-details-marker {
    display: none;
  }

  .mobile-browse-menu-icon {
    color: var(--sb-blue);
    font-size: 1.75rem;
  }

  .mobile-browse-title {
    overflow: hidden;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-browse-category {
    display: inline-flex;
    gap: var(--sb-space-1);
    align-items: center;
    min-height: 44px;
    padding-inline: var(--sb-space-3);
    border-radius: 999px;
    color: var(--sb-text);
    background: var(--sb-surface-blue);
    font-size: var(--sb-size-sm);
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-browse-category .material-symbols-outlined {
    color: var(--sb-blue);
  }

  .mobile-browse-chevron {
    padding-left: var(--sb-space-2);
    border-left: 1px solid var(--sb-border);
    transition: transform 160ms ease;
  }

  .mobile-browse-menu[open] .mobile-browse-summary {
    border-bottom: 1px solid var(--sb-border);
  }

  .mobile-browse-menu[open] .mobile-browse-chevron {
    transform: rotate(180deg);
  }

  .mobile-browse-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sb-space-1);
    padding: var(--sb-space-2);
  }

  .mobile-browse-links a {
    display: flex;
    gap: var(--sb-space-2);
    align-items: center;
    min-width: 0;
    min-height: 46px;
    padding: var(--sb-space-2) var(--sb-space-3);
    border-radius: var(--sb-radius-control);
    color: var(--sb-text);
    font-size: var(--sb-size-sm);
    font-weight: 600;
    text-decoration: none;
  }

  .mobile-browse-links a .material-symbols-outlined {
    flex: 0 0 auto;
    color: var(--sb-blue);
    font-size: 1.25rem;
  }

  .mobile-browse-links a[aria-current="page"],
  .mobile-browse-links a:hover,
  .mobile-browse-links a:focus-visible {
    color: var(--sb-blue);
    background: var(--sb-surface-blue);
  }

  .mobile-browse-account-link {
    border-top: 1px solid var(--sb-border);
  }

  body {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    align-items: end;
    gap: var(--sb-space-1);
    min-height: 72px;
    padding: var(--sb-space-2) var(--sb-space-2) calc(var(--sb-space-2) + env(safe-area-inset-bottom));
    border-top-color: rgb(6 29 92 / 10%);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -12px 30px rgb(6 29 92 / 10%);
  }

  .mobile-bottom-link {
    min-width: 0;
    min-height: 54px;
    gap: 3px;
    padding: 6px 2px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--sb-text-muted);
    background: transparent;
    font-size: 0.72rem;
    line-height: 1;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  }

  .mobile-bottom-link:hover,
  .mobile-bottom-link:focus-visible {
    color: var(--sb-blue);
    background: var(--sb-surface-blue);
  }

  .mobile-bottom-link.is-active:not(.mobile-bottom-link-primary) {
    border-color: rgb(7 81 216 / 10%);
    color: var(--sb-blue);
    background: var(--sb-surface-blue);
  }

  .mobile-bottom-link .material-symbols-outlined {
    font-size: 1.4rem;
  }

  .mobile-bottom-link > span:last-child {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-link-primary {
    min-height: 66px;
    margin-top: -18px;
    padding: 8px 4px;
    transform: translateY(-5px);
    border: 3px solid var(--sb-surface);
    border-radius: 18px;
    color: var(--sb-surface);
    background: linear-gradient(145deg, var(--sb-blue), var(--sb-blue-hover));
    box-shadow: 0 12px 24px rgb(7 81 216 / 26%);
  }

  .mobile-bottom-link-primary .material-symbols-outlined {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    color: var(--sb-surface);
    background: rgb(255 255 255 / 16%);
    font-size: 1.45rem;
  }

  .mobile-bottom-link-primary > span:last-child {
    color: inherit;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .mobile-bottom-link-primary:hover,
  .mobile-bottom-link-primary:focus-visible,
  .mobile-bottom-link-primary.is-active {
    color: var(--sb-surface);
    background: linear-gradient(145deg, var(--sb-blue-hover), var(--sb-navy));
    transform: translateY(-7px);
  }

  .site-issue-button {
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 389.98px) {
  .mobile-bottom-nav {
    padding-inline: var(--sb-space-1);
  }

  .mobile-bottom-link > span:last-child {
    font-size: 0.66rem;
  }

  .mobile-bottom-link-primary {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-link {
    transition: none;
  }
}
