:root {
  --hover-bridge: var(--space-md);
  --admin-bar-height: 32px;
  --top-bar-height: 114px;
}

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), background 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  will-change: transform;
}

.admin-bar .site-header {
  top: var(--admin-bar-height);
}

.site-header.top-bar-hidden {
  transform: translateY(calc(var(--top-bar-height) * -1));
}

@media screen and (max-width: 782px) {
  :root {
    --admin-bar-height: 46px;
  }
}

@media (max-width: 1680px) {
  .site-header {
    padding: 0;
  }
}

@media (max-width: 1440px) {
  .site-header {
    padding: 0;
  }
}

@media (max-width: 1280px) {
  .site-header {
    padding: 0;
  }
}

.site-header.is-scrolled {
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header-top-bar {
  padding: var(--space-sm) 0;
  border-bottom: 2px solid var(--ul-primary);
  background: var(--ul-bg-white);
  width: 100%;
  box-sizing: border-box;
}

.header-top-bar .container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  width: 100%;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.top-bar-logo img {
  height: 80px;
  width: auto;
  display: block;
}

.top-bar-cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  text-align: right;
}

.top-bar-cta .cta-text {
  display: flex;
  flex-direction: column;
}

.top-bar-cta .main-text-line1,
.top-bar-cta .main-text-line2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

.top-bar-cta .main-text-line2 .highlight {
  color: var(--ul-primary);
  font-size: 2rem;
}

.top-bar-cta .cta-number a {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--ul-primary);
  text-decoration: none;
  line-height: 1.2;
  transition: opacity 0.2s ease;
}

.top-bar-cta .cta-number a:hover {
  opacity: 0.8;
}

.site-header > .container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  position: relative;
  z-index: 1;
  width: 100%;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-sm) 0;
}

.header-inner .site-branding {
  display: none;
}

.site-branding img {
  height: 80px;
  width: auto;
  display: block;
}

.site-branding .mobile-logo {
  display: none;
  height: 70px;
}

.header-col {
  flex: 0 0 auto;
  min-width: fit-content;
}

.nav-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: start;
  min-width: 0;
}

.main-navigation > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.main-navigation a {
  font-weight: 600;
  font-size: 1.6rem;
  padding: var(--space-sm) var(--space-md);
  transition: all 0.25s ease;
  display: inline-block;
  border-radius: 9999px;
  color: var(--ul-black);
}

.main-navigation li > a:hover,
.main-navigation li.current-menu-item > a,
.main-navigation li.current-menu-ancestor > a {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.main-navigation .fa-chevron-down {
  font-size: 1.2rem;
  margin-left: var(--space-xs);
  opacity: 0.7;
}

.menu-item-has-children {
  position: relative;
}

.menu-item-has-children::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: 100%;
  height: var(--hover-bridge);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + var(--hover-bridge));
  left: 50%;
  width: 280px;
  transform: translateX(-50%) translateY(-10px);
  border-radius: var(--radius-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
  background: var(--ul-bg-white);
  border: 1px solid var(--ul-secondary-lighter);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.menu-item-has-children:hover > .dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-panel .dropdown-list {
  list-style: none;
  margin: 0;
  padding: var(--space-sm);
}

.dropdown-panel .dropdown-list li a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text-color);
  text-decoration: none;
  box-shadow: none;
  background: transparent;
}

.dropdown-panel .dropdown-list li a:hover {
  background-color: var(--ul-primary-lighter);
  color: var(--ul-white);
  transform: none;
}

.dropdown-panel .dropdown-list li a i {
  margin-right: var(--space-sm);
}

.dropdown-panel.mega-menu {
  width: 850px;
  padding: var(--space-md) var(--space-md);
  border-radius: var(--radius-lg);
}

.mega-menu-columns {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: 0 var(--space-sm);
}

.mega-menu-column {
  flex: 1;
}

.mega-menu-column h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 0 0 var(--space-sm) 0;
  padding: 0 var(--space-sm);
}

.mega-menu-column h3 a {
  color: var(--accent-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0;
  box-shadow: none;
  background: transparent;
}

.mega-menu-column h3 a:hover {
  transform: none;
}

.mega-menu-column h3 i {
  color: var(--ul-primary);
}

.mega-menu-column .dropdown-list {
  padding: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
}

.header-actions .btn {
  height: 44px;
  padding: 0 var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-btn {
  background-color: var(--ul-black);
  color: var(--ul-white);
  position: relative;
}

.search-btn:hover {
  background-color: color-mix(in srgb, var(--ul-black) 85%, white);
  transform: scale(1.05);
}

.search-btn.is-active {
  background-color: var(--ul-cta);
  color: var(--ul-white);
}

.search-btn i {
  font-size: 1.6rem;
  order: 2;
}

.search-btn span {
  order: 1;
}

.search-btn .icon-search {
  font-size: 1.6rem;
}

.search-btn .icon-close {
  font-size: 2rem;
  display: none;
}

.search-btn.is-active .icon-search {
  display: none;
}

.search-btn.is-active .icon-close {
  display: inline-block;
}

.mobile-hamburger {
  display: none;
}

.search-modal {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  width: min(420px, calc(100vw - var(--space-md) * 2));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
  transform: translateY(-10px);
  z-index: 1002;
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.search-modal-content {
  padding: var(--space-sm);
  background: var(--ul-bg-white);
  border: 1px solid var(--ul-secondary-lighter);
  border-radius: 9999px;
}

.search-form {
  display: flex;
  width: 100%;
  position: relative;
}

.search-field {
  flex: 1;
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--ul-secondary-lighter);
  border-radius: 9999px;
  font-size: 1.5rem;
  background: var(--ul-white);
  color: var(--text-color);
  transition: all 0.2s ease;
}

.search-field:focus {
  outline: none;
  border-color: var(--ul-primary);
  background: var(--ul-white);
}

.search-submit {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 9999px;
  background: var(--ul-cta);
  color: var(--ul-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
}

#mobile-menu-content {
  display: none;
}

.mobile-sticky-cta {
  display: none;
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
  .search-btn:hover {
    background-color: #2a2a2a;
  }
}

@media (max-width: 1024px) {
  :root {
    --header-height: 80px;
    --header-top-bar-height: 65px;
  }

  .site-header > .container {
    padding: 0 var(--space-md);
  }

  .site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    padding: 0;
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }

  .site-header.is-hidden {
    transform: translateY(-100%);
  }

  .site-header.top-bar-hidden {
    transform: none;
  }
  
  .admin-bar .site-header {
    top: var(--admin-bar-height);
  }

  .header-top-bar {
    padding: var(--space-sm) 0;
    max-height: none;
  }

  .site-header.top-bar-hidden .header-top-bar {
    transform: none;
    visibility: visible;
  }

  .top-bar-logo {
    display: none;
  }

  .top-bar-cta {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
  }

  .top-bar-cta .cta-text {
    align-items: center;
    flex-shrink: 0;
  }

  .top-bar-cta .main-text-line1,
  .top-bar-cta .main-text-line2 {
    font-size: 1.2rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .top-bar-cta .main-text-line2 .highlight {
    font-size: 1.2rem;
  }

  .top-bar-cta .cta-number a {
    font-size: 2.4rem;
    white-space: nowrap;
  }

  .site-header .header-inner {
    justify-content: space-between;
    height: auto;
    padding: var(--space-md) 0;
  }

  .header-inner .site-branding {
    display: block;
  }

  .main-navigation,
  .site-branding .desktop-logo,
  .header-actions .btn:not(.search-btn) {
    display: none;
  }

  .site-branding .mobile-logo {
    display: block;
  }

  .mobile-hamburger {
    display: inline-flex;
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    background: var(--ul-bg-white);
    border: 1px solid var(--ul-secondary-lighter);
    border-radius: 9999px;
    position: relative;
  }

  .mobile-hamburger button {
    background: none;
    border: none;
    color: var(--ul-cta);
    cursor: pointer;
    font-size: 2rem;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    margin: auto;
  }

  #mobile-menu-toggle {
    display: flex;
  }

  html.mobile-menu-open #mobile-menu-toggle {
    display: none;
  }

  html.mobile-menu-open:not(.show-submenu) #mobile-menu-close {
    display: flex;
  }

  html.mobile-menu-open.show-submenu #mobile-menu-close {
    display: none;
  }

  html.mobile-menu-open.show-submenu #mobile-menu-back {
    display: flex;
  }

  .hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
  }

  .hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: var(--space-2xs);
    background-color: var(--ul-cta);
  }

  .mobile-hamburger i {
    color: var(--ul-cta);
  }

  .header-actions {
    gap: var(--space-xs);
  }

  .search-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--ul-bg-white);
    border: 1px solid var(--ul-secondary-lighter);
    color: var(--ul-cta);
    border-radius: 9999px;
  }

  .header-actions .search-btn {
    border-radius: 9999px;
  }

  .search-btn span {
    display: none;
  }

  .search-btn i {
    order: 1;
    font-size: 1.8rem;
    color: var(--ul-cta);
  }

  .search-btn .icon-search {
    font-size: 1.8rem;
  }

  .search-btn .icon-close {
    font-size: 2.1rem;
  }

  .search-btn.is-active {
    background: var(--ul-bg-white);
    color: var(--ul-cta);
  }

  .search-btn.is-active .icon-close {
    display: block;
  }

  .search-modal {
    position: fixed;
    top: calc(var(--header-height) + var(--header-top-bar-height) + var(--space-xs));
    left: 50%;
    right: auto;
    width: min(520px, calc(100vw - var(--space-sm) * 2));
    transform: translate(-50%, -10px);
    z-index: 1200;
  }

  .admin-bar .search-modal {
    top: calc(var(--header-height) + var(--header-top-bar-height) + var(--space-xs) + var(--admin-bar-height));
  }

  .search-modal.is-open {
    transform: translate(-50%, 0);
  }

  #mobile-menu-content {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--header-height) + var(--header-top-bar-height) + var(--space-xs));
    background-color: transparent;
    z-index: 1000;
    overflow: hidden;
    opacity: 1;
  }

  .admin-bar #mobile-menu-content {
    top: calc(var(--header-height) + var(--header-top-bar-height) + var(--space-xs) + var(--admin-bar-height));
  }

  html.mobile-menu-open #mobile-menu-content {
    display: block;
  }

  html.mobile-menu-open {
    overflow: hidden;
  }

  .mobile-menu-panels-container {
    position: relative;
    width: calc(100% - var(--space-md) * 2);
    margin: 0 auto;
    border-radius: var(--radius-lg);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    background: var(--ul-bg-white);
    border: 1px solid var(--ul-secondary-lighter);
    overflow: hidden;
    max-height: calc(100vh - var(--header-height) - var(--space-md) * 2);
  }

  #mobile-menu-content.menu-slide-in .mobile-menu-panels-container {
    transform: translateY(0);
  }

  #mobile-menu-content.menu-slide-out .mobile-menu-panels-container {
    transform: translateY(-100%);
  }

  .mobile-menu-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    padding: var(--space-md) var(--space-md) var(--space-lg);
    background: var(--ul-bg-white);
    overflow: visible;
  }

  .mobile-menu-panel.is-active {
    transform: translateX(0);
  }

  .main-menu-panel.slide-out-left {
    transform: translateX(-100%);
  }

  .submenu-panel.slide-out-right {
    transform: translateX(100%);
  }

  .main-menu-list,
  .submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .main-menu-list li,
  .submenu-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .main-menu-list a,
  .submenu-list a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    flex: 1;
    transition: color 0.25s ease;
  }

  .main-menu-list a:hover,
  .submenu-list a:hover {
    color: var(--ul-primary);
  }

  .main-menu-list i,
  .submenu-list i {
    font-size: 1.8rem;
    width: 24px;
    min-width: 24px;
    text-align: center;
    color: var(--ul-cta);
  }

  .submenu-toggle {
    cursor: pointer;
    padding-left: var(--space-sm);
    color: var(--ul-cta);
    display: flex;
    align-items: center;
    font-size: 1.6rem;
  }

  .submenu-toggle i {
    pointer-events: none;
  }

  .mobile-submenu-heading {
    font-size: 1.4rem;
    text-transform: uppercase;
    color: var(--accent-color);
    padding: 0 0 var(--space-sm);
    margin: 0 0 var(--space-xs) 0;
    border-bottom: 2px solid var(--ul-primary-lighter);
  }

  .submenu-list {
    margin-bottom: var(--space-md);
  }

  .main-menu-list .menu-item-button {
    border-bottom: none;
    padding-top: var(--space-md);
  }

  .main-menu-list .menu-item-button a {
    color: var(--ul-white);
    border-radius: 9999px;
    padding: var(--space-md);
    justify-content: center;
    width: 100%;
    transition: transform 0.25s ease;
  }

  .main-menu-list .menu-item-button a:hover {
    transform: scale(1.05);
  }

  .menu-item-button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }

  .menu-item-button-group .menu-item-button {
    padding-top: 0;
    border-bottom: none;
  }

  .mobile-sticky-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: transform 0.3s ease;
    will-change: transform;
  }

  .mobile-sticky-cta.is-hidden {
    transform: translateY(120%);
  }

  .mobile-sticky-cta-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    padding: 0;
  }

  .mobile-sticky-cta-inner a {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 var(--space-md);
    border-radius: 9999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    text-transform: uppercase;
    font-weight: 700;
    text-decoration: none;
  }

  .site-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}