/* Sticky header and responsive navigation. The header remains in normal flow. */
:root { --tc-admin-bar-offset: 0px; --tc-header-reserve: var(--tc-header-height, 70px); }
html { scroll-padding-top: calc(var(--tc-header-reserve) + var(--tc-admin-bar-offset) + 16px); }
body.admin-bar { --tc-admin-bar-offset: 32px; }
.tc-header[data-tc-sticky-header] { position: sticky; top: var(--tc-admin-bar-offset); z-index: 1000; width: 100%; }
.tc-header[data-tc-sticky-header].is-scrolled { box-shadow: 0 2px 12px rgb(0 0 0 / 9%); }
.tc-navigation-shell, .tc-navigation-panel { display: contents; }
.tc-navigation-heading, .tc-navigation-backdrop { display: none; }
.tc-header .tc-nav li { position: relative; }
.tc-header .tc-nav li:has(> .tc-submenu-toggle) { padding-right: 23px; }
.tc-submenu-toggle { position: absolute; top: 50%; right: 0; display: inline-grid; width: 23px; height: 30px; place-items: center; transform: translateY(-50%); padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; }
.tc-submenu-toggle::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.tc-submenu-toggle[aria-expanded="true"]::before { transform: rotate(225deg) translate(-1px, -1px); }
.tc-header .tc-nav .sub-menu { display: none; }
.tc-header .tc-nav .sub-menu[data-tc-submenu-ready]:not([hidden]) { display: block; }
.tc-header .tc-nav .sub-menu .sub-menu { top: 0; left: 100%; }
.tc-header .tc-nav .sub-menu li:has(> .tc-submenu-toggle) { padding-right: 25px; }
html.tc-drawer-scroll-locked, html.tc-drawer-scroll-locked body { overflow: hidden; overscroll-behavior: none; }
html.tc-drawer-scroll-locked { scrollbar-gutter: stable; }

@media (max-width: 1023px) {
  .tc-header .tc-navigation-shell { position: fixed; inset: var(--tc-admin-bar-offset) 0 0; z-index: 2; display: flex; justify-content: flex-end; visibility: hidden; pointer-events: none; }
  .tc-header .tc-navigation-shell.is-open { visibility: visible; pointer-events: auto; }
  .tc-header .tc-navigation-shell.is-closing { visibility: visible; }
  .tc-navigation-backdrop { position: absolute; inset: 0; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: rgb(0 0 0 / 48%); opacity: 0; transition: opacity .24s ease; }
  .tc-header .tc-navigation-panel { position: relative; display: flex; flex-direction: column; width: min(360px, calc(100vw - 36px)); height: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fff; color: var(--tc-ink); box-shadow: -8px 0 30px rgb(0 0 0 / 15%); transform: translateX(100%); transition: transform .24s ease; padding: 0 22px max(28px, env(safe-area-inset-bottom)); }
  .tc-navigation-shell.is-open .tc-navigation-panel { transform: translateX(0); }
  .tc-navigation-shell.is-open .tc-navigation-backdrop { opacity: 1; }
  .tc-navigation-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 75px; margin-bottom: 8px; border-bottom: 1px solid var(--tc-border); font-size: 18px; font-weight: 600; }
  .tc-navigation-close { display: inline-grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: #f5f5f5; color: var(--tc-ink); font-family: Arial, sans-serif !important; font-size: 30px !important; line-height: 1; }
  .tc-header .tc-navigation-panel .tc-nav { position: static; display: block; width: 100%; max-height: none; padding: 0; overflow: visible; border: 0; box-shadow: none; }
  .tc-header .tc-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .tc-header .tc-nav a { padding: 15px 4px; font-size: 16px; }
  .tc-header .tc-nav li:has(> .tc-submenu-toggle) { padding-right: 0; }
  .tc-header .tc-nav li:has(> .tc-submenu-toggle) > a { padding-right: 44px; }
  .tc-header .tc-nav .sub-menu, .tc-header .tc-nav .sub-menu .sub-menu { position: static; min-width: 0; width: 100%; margin: 0; padding: 0 0 5px 16px; border: 0; border-radius: 0; box-shadow: none; }
  .tc-header .tc-nav .sub-menu a { font-size: 14px; }
  .tc-header .tc-nav .sub-menu li:has(> .tc-submenu-toggle) { padding-right: 0; }
  .tc-submenu-toggle { top: 5px; right: 0; width: 40px; height: 44px; transform: none; background: transparent; }
}

@media (max-width: 782px) { body.admin-bar { --tc-admin-bar-offset: 46px; } }
@media (prefers-reduced-motion: reduce) { .tc-navigation-panel, .tc-navigation-backdrop { transition: none !important; } }
