/* =========================================================
   YES I CAN ROOFING & EXTERIORS
   BLOCK 01 — HEADER
   VERSION 3 — CENTERED NAV + RED WHATSAPP
   ========================================================= */

:root {
  --header-navy: #03172b;
  --header-navy-deep: #02111f;
  --header-red: #e3131b;
  --header-red-hover: #c90f16;
  --header-white: #ffffff;
  --header-height: 88px;
  --content-max-width: 1460px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: #111820;
  background: #ffffff;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background:
    linear-gradient(
      90deg,
      var(--header-navy-deep) 0%,
      var(--header-navy) 56%,
      #041a31 100%
    );
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 28px rgba(0, 18, 35, 0.14);
}

.site-header__inner {
  width: min(calc(100% - 72px), var(--content-max-width));
  min-height: var(--header-height);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 350px 1fr 250px;
  align-items: center;
  gap: 18px;
}

.site-header__brand {
  justify-self: start;
  display: flex;
  align-items: center;
  width: 350px;
  height: 72px;
  overflow: visible;
  text-decoration: none;
}

.site-header__logo {
  display: block;
  width: 335px;
  height: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: clamp(28px, 2vw, 42px);
  width: 100%;
}

.site-header__link {
  position: relative;
  color: var(--header-white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 160ms ease;
}

.site-header__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  border-radius: 999px;
  background: var(--header-red);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

.site-header__link:hover::after,
.site-header__link:focus-visible::after {
  transform: scaleX(1);
}

.site-header__whatsapp {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  color: var(--header-white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 2px solid var(--header-red);
  border-radius: 9px;
  background: var(--header-red);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.site-header__whatsapp:hover,
.site-header__whatsapp:focus-visible {
  transform: translateY(-1px);
  background: var(--header-red-hover);
  border-color: var(--header-red-hover);
  box-shadow: 0 10px 20px rgba(227, 19, 27, 0.28);
}

.site-header__whatsapp-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: currentColor;
}

.site-header__menu-button {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.site-header__menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: #ffffff;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.site-header__menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.site-header__menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header__mobile-menu {
  background: var(--header-navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__mobile-nav {
  width: min(calc(100% - 40px), 720px);
  margin: 0 auto;
  padding: 14px 0 22px;
  display: flex;
  flex-direction: column;
}

.site-header__mobile-link {
  padding: 15px 2px;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__mobile-whatsapp {
  margin-top: 18px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  border-radius: 9px;
  background: var(--header-red);
}

@media (max-width: 1280px) {
  .site-header__inner {
    width: min(calc(100% - 48px), var(--content-max-width));
    grid-template-columns: 320px 1fr 230px;
    gap: 16px;
  }

  .site-header__brand {
    width: 320px;
  }

  .site-header__logo {
    width: 305px;
  }

  .site-header__nav {
    gap: 24px;
  }

  .site-header__link,
  .site-header__whatsapp {
    font-size: 12px;
  }
}

@media (max-width: 1080px) {
  .site-header__inner {
    min-height: 78px;
    grid-template-columns: 1fr auto;
  }

  .site-header__nav,
  .site-header__whatsapp {
    display: none;
  }

  .site-header__menu-button {
    display: block;
  }

  .site-header__brand {
    width: min(360px, 78vw);
    height: 66px;
  }

  .site-header__logo {
    width: min(340px, 76vw);
  }
}

@media (max-width: 520px) {
  :root {
    --header-height: 70px;
  }

  .site-header__inner {
    width: calc(100% - 26px);
    min-height: 70px;
  }

  .site-header__brand {
    width: min(285px, 76vw);
    height: 58px;
  }

  .site-header__logo {
    width: min(270px, 74vw);
  }

  .site-header__menu-button {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
