/* Site header — two-line icon+wordmark logo lockup, centred pill menu,
   call button and CTA; turns into a floating glass bar on scroll. Loaded
   site-wide since the header appears on every page. */

/* ---------- Logo lockup: icon + stacked two-line wordmark ----------
   Selectors below go through ".header .logo" (3 classes), not just
   ".header" (2) — main.css's ".header .logo img" is 2 classes + the "img"
   element, which otherwise outranks a plain ".header .logo-icon" rule and
   silently wins regardless of load order, no matter what value is set here. */
.header .logo .logo-icon {
  height: 60px;
  width: auto;
  object-fit: contain;
}

/* When the site name text is turned off (Admin → Site Settings →
   Branding), the logo has no wordmark next to it — show it larger so it
   still reads clearly on its own. */
.header .logo .logo-icon-solo {
  max-height: 110px;
}

.header .logo-text-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.header .logo .logo-name {
  font-family: var(--heading-font);
  font-size: 33px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

.header .logo-tagline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--accent-color);
  white-space: nowrap;
}

/* Tablets and phones: a compact bar, so the logo, language button, CTA and
   menu toggle all fit on one row and the header stays shorter than the
   space each page hero leaves for it. */
@media (max-width: 991px) {
  #header.header {
    padding: 12px 0;
  }

  .header .logo .logo-icon-solo {
    height: auto;
    max-height: 68px;
    max-width: 150px;
  }
}

@media (max-width: 575px) {
  #header.header {
    padding: 10px 0;
  }

  .header .logo .logo-icon-solo {
    max-height: 54px;
    max-width: 104px;
  }
}

@media (max-width: 480px) {
  .header .logo .logo-icon {
    height: 42px;
  }

  .header .logo .logo-name {
    font-size: 27px;
  }

  .header .logo-tagline {
    font-size: 10.5px;
  }
}

/* ---------- Header bar ----------
   A clean white bar at the top of the page; once scrolled it lifts into a
   floating, rounded "glass" bar inset from the screen edges. The blur lives
   on .header-glass (a background layer), NOT on #header itself: a
   backdrop-filter/transform on #header would make it the containing block
   for the fixed-position mobile menu inside it and trap that menu in the
   header's box. Height is unchanged (90px at the top), so page heroes that
   pad for it stay correct. */
#header.header {
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: 0;
  transition: top 0.45s cubic-bezier(0.22, 1, 0.36, 1), left 0.45s cubic-bezier(0.22, 1, 0.36, 1), right 0.45s cubic-bezier(0.22, 1, 0.36, 1), padding 0.45s ease;
}

.header-glass {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #fff;
  border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 92%);
  transition: background-color 0.45s ease, border-radius 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
}

@media (min-width: 992px) {
  .scrolled #header.header {
    top: 12px;
    left: 20px;
    right: 20px;
    box-shadow: none;
  }

  .scrolled .header-glass {
    border-radius: 22px;
    background: rgb(255 255 255 / 0.82);
    border: 1px solid rgb(255 255 255 / 0.7);
    box-shadow: 0 18px 50px color-mix(in srgb, var(--heading-color), transparent 86%), 0 2px 8px rgb(0 0 0 / 0.04);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
  }
}

@media (max-width: 991px) {
  .scrolled .header-glass {
    box-shadow: 0 10px 30px color-mix(in srgb, var(--heading-color), transparent 88%);
  }
}

/* ---------- Right-hand actions ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---------- CTA button ---------- */
.header .btn-getstarted,
.header .btn-getstarted:focus {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-color), color-mix(in srgb, var(--accent-color), var(--heading-color) 35%));
  font-weight: 700;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-color), transparent 70%);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Light sweep across the button every few seconds. */
.header .btn-getstarted::after {
  content: "";
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.4), transparent);
  transform: skewX(-20deg);
  animation: header-cta-shine 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes header-cta-shine {
  0%, 65% { left: -70%; }
  100% { left: 130%; }
}

.header .btn-getstarted:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent-color), transparent 60%);
}

.header .btn-getstarted-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-color);
  font-size: 14px;
  transition: transform 0.4s ease;
}

.header .btn-getstarted:hover .btn-getstarted-icon {
  transform: rotate(45deg);
}

@media (max-width: 575px) {
  .header .btn-getstarted,
  .header .btn-getstarted:focus {
    padding: 5px 5px 5px 16px;
    font-size: 0.88rem;
  }

  .header .btn-getstarted-icon {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header .btn-getstarted,
  .header .btn-getstarted:hover,
  .header .btn-getstarted-icon,
  .header .btn-getstarted:hover .btn-getstarted-icon {
    transform: none;
  }

  .header .btn-getstarted::after {
    animation: none;
  }
}

/* ---------- Desktop menu ----------
   Centred in the header container (independent of logo / actions widths).
   Links get a soft pill on hover; the active page gets a filled pill with a
   small dot beneath it. */
@media (min-width: 1200px) {
  .header .navmenu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .header .navmenu > ul {
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--default-color), transparent 96%);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 92%);
  }

  .header .navmenu a,
  .header .navmenu a:focus {
    position: relative;
    padding: 9px 18px;
    border-radius: 999px;
    color: var(--nav-color);
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  .header .navmenu li:last-child a {
    padding-right: 18px;
  }

  .header .navmenu a:hover {
    color: var(--heading-color);
    background: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--heading-color), transparent 90%);
  }

  .header .navmenu .active,
  .header .navmenu .active:focus,
  .header .navmenu .active:hover {
    color: #fff;
    background: var(--heading-color);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--heading-color), transparent 75%);
  }

  .header .navmenu .active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: var(--accent-color);
  }
}

/* ---------- Mobile menu ---------- */
@media (max-width: 1199px) {
  .header .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 0 0 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--default-color), transparent 94%);
    color: var(--heading-color);
    font-size: 24px;
  }

  .mobile-nav-active .header .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgb(255 255 255 / 0.15);
    color: #fff;
    top: 20px;
    right: 20px;
  }

  .mobile-nav-active .navmenu {
    background: color-mix(in srgb, var(--heading-color), transparent 12%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  .navmenu ul {
    inset: 80px 20px auto 20px;
    padding: 12px;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgb(0 0 0 / 0.3);
  }

  .navmenu a,
  .navmenu a:focus {
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 600;
  }

  .navmenu a:hover,
  .navmenu .active,
  .navmenu .active:focus {
    color: #fff;
    background: var(--accent-color);
  }
}

/* Keep the mobile order logo → actions → menu toggle (main.css only
   orders the old standalone CTA button). */
@media (max-width: 1200px) {
  .header .header-actions {
    order: 2;
  }

  .header .header-actions .btn-getstarted {
    order: 0;
    margin: 0;
  }
}

/* ---------- Language switcher ---------- */
.lang-switch {
  position: relative;
}

.lang-switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 88%);
  border-radius: 50px;
  background: #fff;
  color: var(--heading-color);
  font-family: var(--nav-font);
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.lang-switch-toggle:hover,
.lang-switch-toggle[aria-expanded="true"] {
  border-color: var(--accent-color);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--heading-color), transparent 88%);
}

.lang-switch-toggle img,
.lang-switch-menu img {
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
}

.lang-switch-toggle .bi-chevron-down {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.lang-switch-toggle[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.lang-switch-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 44px color-mix(in srgb, var(--heading-color), transparent 84%);
}

[dir="rtl"] .lang-switch-menu {
  right: auto;
  left: 0;
}

.lang-switch-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 600;
  text-align: start;
}

.lang-switch-menu button:hover {
  background: color-mix(in srgb, var(--accent-color), transparent 90%);
}

.lang-switch-menu button.is-current {
  color: var(--accent-color);
}

.lang-switch-menu .bi-check2 {
  margin-inline-start: auto;
}

@media (max-width: 575px) {
  .lang-switch-toggle {
    height: 40px;
    padding: 0 9px;
  }

  .lang-switch-toggle .lang-switch-code {
    display: none;
  }

  .header .header-actions {
    gap: 8px;
  }

  .header .mobile-nav-toggle {
    width: 40px;
    height: 40px;
    margin-left: 8px;
    font-size: 22px;
  }
}

/* Small phones: drop the chevron and the CTA's arrow circle so the whole
   row still fits next to the logo. */
@media (max-width: 400px) {
  .lang-switch-toggle {
    padding: 0 10px;
  }

  .lang-switch-toggle .bi-chevron-down {
    display: none;
  }

  .header .btn-getstarted,
  .header .btn-getstarted:focus {
    padding: 9px 14px;
    font-size: 0.82rem;
  }

  .header .btn-getstarted-icon {
    display: none;
  }
}

/* The menu sits in the normal flow between the logo and the right-hand
   buttons (not absolutely page-centred), so the language button and longer
   translated words can never slide underneath it. */
@media (min-width: 1200px) {
  .header .navmenu {
    position: static;
    transform: none;
    margin-inline: auto;
    padding-inline: 16px;
  }

  /* main.css's "max-width: 1200px" reordering also matches exactly 1200px. */
  .header .logo,
  .header .navmenu {
    order: 0;
  }

  /* Translated menus (Google adds these classes to <html>) run longer. */
  html.translated-ltr .header .navmenu a,
  html.translated-rtl .header .navmenu a {
    padding: 9px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  html.translated-ltr .header .navmenu li:last-child a,
  html.translated-rtl .header .navmenu li:last-child a {
    padding-right: 12px;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  .header .navmenu a,
  .header .navmenu a:focus {
    padding: 9px 14px;
  }

  .header .navmenu li:last-child a {
    padding-right: 14px;
  }

  html.translated-ltr .header .navmenu a,
  html.translated-rtl .header .navmenu a {
    padding: 8px 9px;
    font-size: 13px;
  }

  html.translated-ltr .header .btn-getstarted,
  html.translated-rtl .header .btn-getstarted {
    font-size: 13px;
  }
}

/* Translated "Get a Quote" labels run longer: keep the button on one line
   on phones. */
.header .btn-getstarted > span:not(.btn-getstarted-icon) {
  white-space: nowrap;
}

@media (max-width: 575px) {
  html.translated-ltr .header .btn-getstarted,
  html.translated-rtl .header .btn-getstarted {
    padding-inline-start: 12px;
    font-size: 0.78rem;
  }

  html.translated-ltr .header-actions,
  html.translated-rtl .header-actions {
    gap: 8px;
  }
}

@media (max-width: 400px) {
  html.translated-ltr .header .btn-getstarted,
  html.translated-rtl .header .btn-getstarted {
    padding: 8px 12px;
  }

  html.translated-ltr .header .btn-getstarted-icon,
  html.translated-rtl .header .btn-getstarted-icon {
    display: none;
  }

  html.translated-ltr .header .btn-getstarted > span:not(.btn-getstarted-icon),
  html.translated-rtl .header .btn-getstarted > span:not(.btn-getstarted-icon) {
    display: block;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
