/** Header */

/* Section: Top bar. Variant follows Astra's own header state
   (body.ast-desktop / body.ast-header-break-point), NOT a separate media
   query, so the bar can never disagree with the hamburger in the
   scrollbar-gutter band where min- and max-width evaluate differently.
   Base (no ast-desktop class): mobile logo bar. */
.site-top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 99;
  height: auto;
  min-height: 56px;
  margin-top: 0;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  background-color: var(--color-white);
  color: var(--color-text);
}

.site-top-bar .top-bar-announcement {
  display: none !important;
}

.site-top-bar .top-bar-mobile-logo {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  margin: 0 auto;
  text-align: center;
}

.site-top-bar .mobile-logo-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0;
  text-align: center;
  text-decoration: none;
}

.site-top-bar .mobile-logo-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.site-top-bar img.mobile-top-logo {
  display: block;
  max-height: 40px;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}

.site-top-bar .custom-logo-link,
.site-top-bar .custom-logo {
  display: block;
  margin: 0 auto;
  max-height: 40px;
  width: auto;
}

.site-top-bar .mobile-top-logo-fallback {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--color-text);
}

/* Desktop announcement variant — only when Astra itself is in desktop mode. */
body.ast-desktop .site-top-bar {
  min-height: 35px;
  padding: 9px 24px;
  font-size: 14px;
  background-color: var(--color-text);
  color: var(--color-white);
}

body.ast-desktop .site-top-bar .top-bar-announcement {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

body.ast-desktop .site-top-bar .top-bar-mobile-logo {
  display: none !important;
}

body.ast-desktop .site-top-bar .top-bar-content span,
body.ast-desktop .site-top-bar .top-bar-content a {
  color: var(--color-white);
}

body.ast-desktop .site-top-bar .top-bar-content a {
  font-weight: 600;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

body.ast-desktop .site-top-bar .top-bar-content a:hover {
  opacity: 0.8;
}

body.ast-desktop .site-top-bar .top-bar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-white);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* Section: Sticky header. */
.ast-main-header-wrap,
.ast-mobile-header-wrap,
#masthead {
  width: 100%;
  transition: all 0.3s ease-in-out;
  z-index: 300;
}

.ast-main-header-wrap.is-sticky,
.ast-mobile-header-wrap.is-sticky,
#masthead.is-sticky {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  animation: slideDown 0.35s ease-out forwards;
}

.ast-mobile-header-wrap.is-sticky .main-header-bar-navigation {
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Section: Responsive. Mobile-first base (0-639px): compact padding. */
.main-header-bar,
.ast-main-header-wrap .ast-container,
.ast-mobile-header-wrap .ast-container {
  padding-left: 15px !important;
  padding-right: 15px !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) {
  .main-header-bar,
  .ast-main-header-wrap .ast-container,
  .ast-mobile-header-wrap .ast-container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* Section: Header grid. */
:is(.site-above-header-wrap, .site-primary-header-wrap, .site-below-header-wrap)
  .ast-builder-grid-row-has-sides.ast-grid-center-col-layout {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
}

:is(.site-above-header-wrap, .site-primary-header-wrap, .site-below-header-wrap)
  .ast-builder-grid-row-has-sides.ast-grid-center-col-layout
  > .site-header-section-left {
  justify-content: flex-start;
}

:is(.site-above-header-wrap, .site-primary-header-wrap, .site-below-header-wrap)
  .ast-builder-grid-row-has-sides.ast-grid-center-col-layout
  > :is(.ast-grid-section-center, .ast-grid-right-section) {
  justify-content: flex-end;
}

:is(.site-above-header-wrap, .site-primary-header-wrap, .site-below-header-wrap)
  .ast-builder-grid-row-has-sides.ast-grid-center-col-layout
  > .ast-grid-section-center {
  min-width: 0;
}
