:root { --masthead-height: 96px; }
.masthead {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 22px;
  height: var(--masthead-height);
  padding-inline: var(--avis-edge);
  background-color: rgb(225 229 232 / 94%);
  color: #22292e;
  border-bottom: 1px solid rgb(39 47 53 / 13%);
  font: 500 15px/1.35 Vela, Arial, sans-serif;
}
/* Extend the existing Hero photograph beneath the sticky header. */
#home .hero-media { top: calc(-1 * var(--masthead-height)); }

@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .masthead {
    background-color: rgb(228 231 233 / 78%);
    -webkit-backdrop-filter: blur(14px) saturate(.65);
    backdrop-filter: blur(14px) saturate(.65);
  }
}
.masthead nav, .masthead-actions, .masthead-channels, .masthead-contact-group, .masthead .social-marks {
  display: flex;
  align-items: center;
}
.masthead nav { gap: clamp(16px, 1.7vw, 28px); }
.masthead a { white-space: nowrap; }
.masthead a:hover { text-decoration: underline; text-underline-offset: 4px; }
.masthead-brand { display: grid; justify-items: center; gap: 3px; }
.masthead-brand img { width: 174px; height: auto; display: block; }
.masthead-brand span { font-size: 12px; font-weight: 400; }
.masthead-actions { justify-content: flex-end; gap: 16px; }
.masthead-phone { font-size: 17px; }
.masthead-callback {
  display: inline-grid;
  place-items: center;
  width: clamp(152px, 12.65vw, 182px);
  height: 52px;
  background: transparent;
  border: 1px solid #696969;
  border-radius: 15px;
  font-size: clamp(14px, 1.12vw, 16px);
  font-weight: 500;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.masthead .masthead-callback:is(:hover, :focus-visible) {
  background-color: #e76f41;
  border-color: #e76f41;
  text-decoration: none;
}
.masthead .social-marks { gap: 9px; }
.social-marks svg { width: 20px; height: 20px; }
.masthead-phone svg, .masthead-menu-contacts { display: none; }
#contact .contact-email { display: inline-block; margin-top: 12px; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@media (width < 1200px) {
  :root { --masthead-height: 76px; }
  .masthead { grid-template-columns: auto 1fr; padding-inline: max(20px, var(--avis-edge)); }
  .masthead-brand img { width: 146px; }
  .masthead-brand span { font-size: 11px; }
  .masthead-actions { gap: 4px; }
  .masthead-channels > .social-marks, .masthead-contact-group, .masthead-phone span { display: none; }
  .masthead-phone, .masthead .menu-toggle {
    display: flex; width: 44px; height: 44px; align-items: center; justify-content: center;
  }
  .masthead-phone svg { display: block; width: 27px; height: 27px; }
  .masthead .menu-toggle { flex-direction: column; gap: 6px; color: inherit; border: 0; padding: 0; background: transparent; }
  .masthead .menu-toggle span { width: 23px; height: 1.5px; background: currentColor; }
  .masthead nav {
    display: none; position: absolute; top: 100%; inset-inline: 0; max-height: calc(100dvh - 76px);
    overflow-y: auto; padding: 12px max(20px, var(--avis-edge)) 24px; background: white; color: #22292e;
    border-top: 1px solid #e4e6e7;
  }
  .masthead nav.open, .masthead-menu-contacts { display: grid; gap: 0; }
  .masthead nav a { display: flex; align-items: center; min-height: 44px; width: fit-content; }
  .masthead-menu-contacts { border-top: 1px solid #e4e6e7; padding-top: 10px; margin-top: 8px; }
  .masthead-menu-contacts .social-marks { margin-top: 10px; }
}

@media (min-width: 1200px) {
  .masthead {
    grid-template-columns: minmax(max-content, 1fr) auto auto;
    column-gap: clamp(24px, 3vw, 50px);
    font-weight: 400;
  }
  .masthead nav {
    gap: clamp(16px, 1.6vw, 26px);
    font-size: 16px;
  }
  .masthead-brand { gap: 4px; }
  .masthead-brand img { width: clamp(166px, 13vw, 196px); }
  .masthead-brand span { font-size: 11.5px; line-height: 15px; }
  .masthead-actions, .masthead-contact-group { gap: clamp(14px, 1.45vw, 24px); }
  .masthead-email { font-size: 16px; }
  .masthead-channels, .masthead-channels .social-marks { gap: 10px; }
  .masthead-channels .contact-icon {
    width: clamp(44px, 3.62vw, 52px);
    height: clamp(44px, 3.62vw, 52px);
    border-radius: 15px;
    background: rgb(92 104 116 / 12%);
  }
  .masthead-channels .contact-icon svg { display: block; width: 24px; height: 24px; }
}

/* Shared interaction for the three contact icons. */
.masthead-channels .contact-icon {
  position: relative;
  display: grid;
  place-items: center;
  color: inherit;
  transition: background-color 220ms ease, color 220ms ease;
}
.masthead-channels .contact-icon:is(:hover, :focus-visible) {
  background-color: rgb(255 255 255 / 38%);
  color: #10171b;
  text-decoration: none;
}
.masthead-channels .contact-icon:focus-visible {
  outline: 2px solid #59646c;
  outline-offset: 3px;
}
.masthead-channels .contact-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  max-width: 240px;
  padding: 8px 12px;
  border-radius: 7px;
  background: #292d30;
  color: #fff;
  font: 400 13px/1.4 Vela, Arial, sans-serif;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}
.masthead-channels .contact-icon:is(:hover, :focus-visible)::after {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .masthead-callback, .masthead-channels .contact-icon, .masthead-channels .contact-icon::after { transition: none; }
}
