/* =========================================================
   HEADER — START
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: var(--ink);
  background: var(--white);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
  will-change: transform;
  overflow: visible;
}

.site-header.is-scrolled {
  box-shadow: none;
}

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

.header-shell {
  width: min(1280px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Utility bar */
.util-bar {
  background: var(--white);
  color: #000000;
  font-size: 0.78rem;
  font-weight: 520;
  border-bottom: 1px solid #e5e7eb;
}

.util-bar .header-shell {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.08rem 0 0.2rem;
  flex-wrap: wrap;
}

.util-bar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem clamp(0.65rem, 1.5vw, 1.15rem);
}
.util-bar__group--tools { justify-content: flex-end; }
.util-bar a:hover { color: #111827; }

.util-bar__pay {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.7rem 0.18rem 0.8rem;
  border: 0;
  border-radius: 0.3rem;
  background: #e8f1fb;
  color: #000000;
  font-weight: 520;
}
.util-bar__pay:hover { background: #dceaf8; color: #111827; }

/* Brand bar */
.brand-bar {
  background: var(--white);
  color: var(--ink);
  overflow: visible;
}

.brand-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 2vw, 1.15rem) clamp(1rem, 2.5vw, 1.5rem);
  min-height: clamp(3.75rem, 7.5vw, 4.5rem);
  padding: clamp(0.25rem, 0.9vw, 0.4rem) 0;
  position: relative;
}

.brand-bar .logo {
  flex: 0 0 auto;
  margin: 0;
  line-height: 0;
  overflow: visible;
  z-index: 2;
}

.brand-bar .logo img {
  display: block;
  height: var(--header-logo-h);
  width: auto;
  max-width: min(42vw, 18rem);
  object-fit: contain;
  object-position: left center;
}

/* News ticker */
.news-ticker {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 12rem;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 2.75rem), transparent);
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 2.75rem), transparent);
}

.news-ticker__lead {
  flex-shrink: 0;
  margin-left: 0;
  margin-right: 0;
  color: var(--maroon);
  font-size: clamp(0.78rem, 1.15vw, 0.92rem);
  font-weight: 700;
  white-space: nowrap;
}

.news-ticker__marquee {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 100%);
}

.news-ticker__track {
  display: flex;
  width: max-content;
  animation: tickerMarquee 28s linear infinite;
  will-change: transform;
}

.news-ticker__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.news-ticker__item {
  position: relative;
  flex-shrink: 0;
  color: #2f3338;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0 1.1rem 0 1.15rem;
}
.news-ticker__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2a2a2a;
  transform: translateY(-50%);
}

@keyframes tickerMarquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* Brand search — mobile only */
.brand-search {
  display: none;
  width: 2.15rem;
  height: 2.15rem;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  border-radius: 0.45rem;
  flex-shrink: 0;
}
.brand-search:hover {
  background: rgba(0, 33, 71, 0.06);
}
.brand-search svg {
  display: block;
}

.mobile-search {
  display: none;
}

/* Brand actions */
.brand-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.brand-apply {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.62rem 1.15rem;
  border-radius: 0.85rem;
  background: var(--gold);
  color: var(--btn-ink);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s;
}
.brand-apply:hover {
  background: var(--gold-soft);
}
.brand-apply svg {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.brand-apply:hover svg { transform: translateX(2px); }

/* Nav toggle */
.nav-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0.4rem;
  color: var(--navy);
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =========================================================
   HEADER — Desktop
   ========================================================= */

@media (min-width: 781px) {
  .news-ticker {
    margin-left: var(--header-ticker-shift);
    min-width: 10rem;
  }
  .brand-search,
  .mobile-search {
    display: none !important;
  }
}

/* =========================================================
   HEADER — Tablet (781–1024px)
   ========================================================= */

@media (min-width: 781px) and (max-width: 1024px) {
  :root {
    --header-edge-inset: clamp(0.65rem, 1.8vw, 1.15rem);
    --header-logo-h: clamp(3rem, 4.6vw, 3.55rem);
    --header-logo-scale: 1.04;
    --header-logo-slot: clamp(6.75rem, 22vw, 9.25rem);
    --header-ticker-shift: -0.65rem;
    --header-ticker-lead-inset: clamp(0.25rem, 1.2vw, 0.85rem);
  }

  .util-bar__group--tools {
    gap: 0.15rem 0.65rem;
    font-size: 0.72rem;
  }

  .brand-bar__inner {
    min-height: 5rem;
  }

  .news-ticker__lead {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* =========================================================
   HEADER — Mobile (≤780px)
   ========================================================= */

@media (max-width: 780px) {
  :root {
    --header-logo-h: 2.95rem;
  }

  .site-header {
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
    will-change: auto;
  }

  .util-bar,
  .brand-bar {
    max-width: 100%;
    overflow-x: clip;
  }

  .header-shell {
    width: min(1280px, calc(100% - 1.5rem));
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Utility: one compact scroll row */
  .util-bar {
    font-size: 0.68rem;
  }
  .util-bar .header-shell {
    flex-wrap: nowrap;
    min-height: 1.6rem;
    height: 1.6rem;
    padding: 0;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .util-bar .header-shell::-webkit-scrollbar {
    display: none;
  }
  .util-bar__group {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 0.15rem 0.7rem;
  }
  .util-bar__group a {
    white-space: nowrap;
  }
  .util-bar__group--tools {
    gap: 0.15rem 0.55rem;
    margin-left: auto;
  }
  .util-bar__pay {
    padding: 0.1rem 0.5rem 0.1rem 0.55rem;
    font-size: inherit;
  }

  /* Brand: search | logo | menu */
  .brand-bar__inner {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    align-items: center;
    min-height: 0;
    height: auto;
    padding: 0;
    gap: 0.45rem;
    max-width: 100%;
    min-width: 0;
  }

  .brand-search {
    display: grid;
    place-items: center;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    width: 2.5rem;
    height: 2.5rem;
  }
  .brand-search svg {
    width: 1.45rem;
    height: 1.45rem;
  }

  .brand-bar .logo {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 1;
    min-height: 3.6rem;
    min-width: 0;
    max-width: 100%;
    justify-self: center;
    overflow: hidden;
  }
  .brand-bar .logo img {
    height: var(--header-logo-h);
    width: auto;
    max-width: min(58vw, 13rem);
    object-position: center;
  }

  .brand-bar__actions {
    gap: 0;
    margin-left: 0;
    min-height: 3.6rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  /* Slim single-line ticker under brand — must not widen the page */
  .news-ticker {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    gap: 0;
    min-height: 1.4rem;
    height: 1.4rem;
    align-items: center;
    border-top: 1px solid #eef0f3;
    overflow: hidden;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .news-ticker__lead {
    display: none;
  }
  .news-ticker__marquee {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 0.5em, #000 calc(100% - 0.5em), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 0.5em, #000 calc(100% - 0.5em), transparent);
  }
  .news-ticker__track {
    max-width: none;
  }
  .news-ticker__item {
    font-size: 0.72rem;
    padding: 0 0.85rem 0 0.9rem;
  }
  .news-ticker__item::before {
    width: 4px;
    height: 4px;
  }

  .brand-apply { display: none; }
  .nav-toggle {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.35rem;
    gap: 5px;
  }
  .nav-toggle span {
    height: 2px;
  }
  .site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Expandable search under brand bar */
  .mobile-search {
    display: block;
    border-top: 1px solid #eef0f3;
    background: var(--white);
    max-width: 100%;
    overflow-x: clip;
  }
  .mobile-search[hidden] {
    display: none !important;
  }
  .mobile-search__form {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: min(1280px, calc(100% - 1.5rem));
    max-width: 100%;
    box-sizing: border-box;
    margin-inline: auto;
    padding: 0.55rem 0;
  }
  .mobile-search__icon {
    flex-shrink: 0;
    color: #9ca3af;
  }
  .mobile-search__form input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
  }
  .mobile-search__close {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--maroon);
    padding: 0.25rem 0.35rem;
  }

  .site-header.is-open,
  .site-header.is-open.is-hidden {
    transform: none;
    z-index: 400;
  }
}

/* =========================================================
   HEADER — END
   ========================================================= */