/* Shared header, primary navigation, and mobile quote CTA. */

.mm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h, 72px);
  background: rgba(19, 10, 34, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  transition: height 0.3s var(--mm-ease), background 0.3s var(--mm-ease), box-shadow 0.3s var(--mm-ease);
}

.admin-bar .mm-header {
  top: 32px;
}

.mm-header.is-scrolled {
  height: 64px;
  background: rgba(20, 11, 35, 0.97);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.3);
}

.mm-header__inner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  height: 100%;
  column-gap: 24px;
  min-width: 0;
}

.mm-header .mm-header__inner.mm-container {
  width: 100%;
  max-width: var(--mm-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
  box-sizing: border-box;
}

.mm-header__brand {
  order: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  justify-self: start;
  min-width: 0;
}

.mm-header__logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  text-decoration: none;
}

.mm-logo-img {
  display: block;
  width: auto;
  height: 40px;
  max-width: 176px;
  object-fit: contain;
}

.mm-header__utilities {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.mm-header__utilities .mm-lang-switcher {
  --mm-lang-gap: 3px;
  --mm-lang-pad: 3px;
  grid-template-columns: repeat(2, minmax(40px, 1fr));
}

.mm-header__utilities .mm-lang-switcher__link {
  min-width: 40px;
  height: 36px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

.mm-header__nav {
  order: 2;
  display: block;
  justify-self: center;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

.mm-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-nav__item {
  flex: 0 0 auto;
}

.mm-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--mm-ease-fast), background 0.2s var(--mm-ease-fast), transform 0.2s var(--mm-ease);
}

.mm-nav__link:hover,
.mm-nav__link:focus-visible,
.mm-nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.mm-header__actions {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 12px;
  flex: 0 0 auto;
  margin-left: 0;
  padding-left: 0;
}

.mm-header__cta {
  min-width: 150px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 12px;
  white-space: nowrap;
}

.mm-header__hamburger {
  order: 4;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.mm-hamburger__bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.24s var(--mm-ease), opacity 0.24s var(--mm-ease);
}

.mm-header__hamburger[aria-expanded="true"] .mm-hamburger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mm-header__hamburger[aria-expanded="true"] .mm-hamburger__bar:nth-child(2) {
  opacity: 0;
}

.mm-header__hamburger[aria-expanded="true"] .mm-hamburger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mm-nav__item--mobile-cta {
  display: none;
}

.mm-mobile-quote-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(13, 8, 24, 0.96);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(105%);
  transition: opacity 0.24s var(--mm-ease), transform 0.24s var(--mm-ease);
}

.mm-mobile-quote-cta.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mm-mobile-quote-cta__inner {
  width: min(100%, 520px);
  margin-inline: auto;
}

.mm-mobile-quote-cta__btn {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  text-decoration: none;
}

body.mm-nav-open .mm-mobile-quote-cta {
  opacity: 0;
  pointer-events: none;
  transform: translateY(105%);
}

@media (max-width: 1120px) and (min-width: 961px) {
  .mm-header__inner {
    grid-template-columns: minmax(236px, 1fr) auto minmax(138px, 1fr);
    column-gap: 18px;
  }

  .mm-logo-img {
    height: 38px;
    max-width: 160px;
  }

  .mm-nav__link {
    padding-inline: 10px;
    font-size: 0.8rem;
  }

  .mm-header__actions {
    gap: 8px;
  }

  .mm-header__cta {
    min-width: 132px;
    padding-inline: 14px;
    font-size: 0.84rem;
  }
}

@media (max-width: 960px) {
  .admin-bar .mm-header {
    top: 46px;
  }

  .mm-header {
    height: 64px;
  }

  .mm-header__inner {
    display: flex;
    gap: 8px;
  }

  .mm-header__brand {
    order: 1;
    flex: 1 1 auto;
    gap: 8px;
  }

  .mm-header__logo {
    flex: 1 1 auto;
  }

  .mm-logo-img {
    height: 36px;
    max-width: 136px;
  }

  .mm-header__actions {
    gap: 0;
    flex-shrink: 0;
  }

  .mm-header__utilities {
    flex-shrink: 0;
  }

  .mm-header__utilities .mm-lang-switcher {
    display: inline-grid !important;
  }

  .mm-header__cta {
    display: none !important;
  }

  .mm-header__hamburger {
    display: flex !important;
    flex-shrink: 0;
  }

  .mm-header__nav {
    display: none !important;
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 999;
    max-height: calc(100svh - 88px);
    overflow-y: auto;
    margin-left: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(13, 8, 24, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .admin-bar .mm-header__nav {
    top: 110px;
  }

  .mm-header__nav.is-open {
    display: block !important;
  }

  .mm-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .mm-nav__link {
    justify-content: center;
    text-align: center;
    min-height: 48px;
    padding: 13px 14px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .mm-nav__item--mobile-cta {
    display: block !important;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .mm-nav__link--quote {
    justify-content: center;
    gap: 8px;
    color: #1a1200;
    background: linear-gradient(135deg, var(--mm-gold-light), var(--mm-gold));
    box-shadow: 0 10px 28px rgba(212, 160, 23, 0.25);
  }

  .mm-nav__link--quote:hover,
  .mm-nav__link--quote:focus-visible {
    color: #1a1200;
    background: linear-gradient(135deg, #f4ca48, var(--mm-gold));
  }

  .mm-mobile-quote-cta {
    display: block;
  }

  .mm-footer {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.mm-nav-open {
    overflow: hidden;
  }
}

@media (max-width: 360px) {
  .mm-logo-img {
    max-width: 118px;
  }

  .mm-lang-switcher__link {
    min-width: 40px;
    padding-inline: 10px;
  }
}

/* Keep the shared header consistent when legacy page styles are also loaded. */
body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header {
  height: var(--header-h, 72px);
  background: rgba(19, 10, 34, 0.88) !important;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header.is-scrolled {
  height: 64px;
  background: rgba(20, 11, 35, 0.97) !important;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__inner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(150px, 1fr);
  justify-content: stretch;
  column-gap: 24px;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-header__inner.mm-container {
  width: 100%;
  max-width: var(--mm-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 4vw, 48px);
  padding-right: clamp(20px, 4vw, 48px);
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__brand {
  order: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  justify-self: start;
  min-width: 0;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-logo-img {
  height: 40px;
  max-width: 176px;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__utilities {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__nav {
  order: 2;
  display: block;
  justify-self: center;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-nav__item {
  flex: 0 0 auto;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link:hover,
body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link:focus-visible,
body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

body.mm-lawn-page .mm-header .mm-nav__link.is-active {
  color: #9bea6a;
  background: rgba(102, 189, 56, 0.14);
  box-shadow: inset 0 0 0 1px rgba(102, 189, 56, 0.2);
}

body.mm-driveway-page .mm-header .mm-nav__link.is-active {
  color: var(--mm-gold-light);
  background: rgba(212, 160, 23, 0.14);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.2);
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__actions {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 12px;
  flex: 0 0 auto;
  margin-left: 0;
  padding-left: 0;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__cta {
  display: inline-flex;
  min-width: 150px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 12px;
  white-space: nowrap;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__hamburger {
  order: 4;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-hamburger__bar {
  width: 22px;
  height: 2px;
  background: currentColor;
}

body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-nav__item--mobile-cta {
  display: none;
}

@media (max-width: 1120px) and (min-width: 961px) {
  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__inner {
    grid-template-columns: minmax(236px, 1fr) auto minmax(138px, 1fr);
    column-gap: 18px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-logo-img {
    height: 38px;
    max-width: 160px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link {
    padding-inline: 10px;
    font-size: 0.8rem;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__actions {
    gap: 8px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__cta {
    min-width: 132px;
    padding-inline: 14px;
    font-size: 0.84rem;
  }
}

@media (max-width: 960px) {
  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header {
    height: 64px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__inner {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__brand {
    order: 1;
    flex: 1 1 auto;
    gap: 8px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__logo {
    flex: 1 1 auto;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__utilities {
    order: 2;
    flex-shrink: 0;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-logo-img {
    height: 36px;
    max-width: 136px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__actions {
    gap: 0;
    margin-left: 0;
    padding-left: 0;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__utilities .mm-lang-switcher {
    display: inline-grid !important;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__cta,
  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__actions .mm-btn,
  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__actions .mm-btn--sm {
    display: none !important;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__hamburger {
    order: 3;
    display: flex !important;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-left: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__nav {
    order: 4;
    display: none !important;
    position: fixed;
    top: calc(64px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    z-index: 999;
    width: auto;
    max-height: calc(100svh - 88px);
    overflow-y: auto;
    margin-left: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(13, 8, 24, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  body.admin-bar:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__nav {
    top: 110px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header__nav.is-open {
    display: block !important;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-nav__item {
    width: 100%;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link {
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border-radius: 8px;
    font-size: 1rem;
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-nav__item--mobile-cta {
    display: block !important;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link--quote {
    justify-content: center;
    gap: 8px;
    color: #1a1200;
    background: linear-gradient(135deg, var(--mm-gold-light), var(--mm-gold));
    box-shadow: 0 10px 28px rgba(212, 160, 23, 0.25);
  }

  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link--quote:hover,
  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-header .mm-nav__link--quote:focus-visible {
    color: #1a1200;
    background: linear-gradient(135deg, #f4ca48, var(--mm-gold));
  }
}

@media (max-width: 360px) {
  body:is(.mm-homepage, .mm-quote-page, .mm-driveway-page, .mm-lawn-page) .mm-logo-img {
    max-width: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mm-header,
  .mm-nav__link,
  .mm-hamburger__bar,
  .mm-mobile-quote-cta {
    transition: none !important;
  }
}

@media (min-width: 901px) {
  body.mm-driveway-page .mm-header .mm-header__inner.mm-container {
    max-width: none;
    padding-left: clamp(20px, 5.5vw, 88px);
    padding-right: clamp(20px, 5.5vw, 88px);
  }
}
