/* ===== Rangzivo Header Fix ===== */

/* 1. Header wrapper: full width, nothing spills outside */
html body header,
html body .site-header,
html body #masthead,
html body .elementor-location-header,
html body header.wp-block-template-part {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* 2. Logo + menu + button in one row, wrapping if space is short */
html body .site-header .header-inner,
html body .site-header .container,
html body #masthead .container,
html body #masthead .header-inner,
html body header .wp-block-group,
html body header .header-wrap,
html body header > div {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px 24px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* 3. Logo should never be covered by the menu */
html body header .site-logo,
html body header .logo,
html body header .custom-logo-link,
html body header .site-branding,
html body header .site-title {
  position: static !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  order: 1 !important;
}

/* 4. Menu: flows next to logo, no absolute positioning, wraps if needed */
html body header nav,
html body header .main-navigation,
html body header .primary-menu,
html body header .wp-block-navigation {
  position: static !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  order: 3 !important;
}

html body header nav ul,
html body header .menu,
html body header .wp-block-navigation__container {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 8px 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* 5. Get a Quote button stays inside the header, in the middle */
html body header .header-cta,
html body header .cta-button,
html body header .wp-block-buttons,
html body header .wp-block-button,
html body header a.button,
html body header a[href*="quote"],
html body header a[href*="contact"].btn {
  position: static !important;
  flex: 0 0 auto !important;
  order: 2 !important;
  margin: 0 auto !important;
  float: none !important;
}

/* 6. Smaller screens: stack neatly */
@media (max-width: 900px) {
  html body header nav ul,
  html body header .menu,
  html body header .wp-block-navigation__container {
    justify-content: flex-start !important;
    gap: 8px 16px !important;
  }
  html body header .header-cta,
  html body header .cta-button,
  html body header .wp-block-buttons,
  html body header .wp-block-button,
  html body header a.button {
    order: 4 !important;
    flex: 1 0 100% !important;
    margin: 4px auto 0 !important;
    text-align: center !important;
  }
}

/* 7. Mobile: smaller logo, menu text and button */
@media (max-width: 768px) {
  html body header,
  html body .site-header,
  html body #masthead {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  html body header .site-logo,
  html body header .logo,
  html body header .custom-logo-link,
  html body header .site-branding,
  html body header .site-title,
  html body header .site-title a {
    font-size: 18px !important;
    letter-spacing: 0.5px !important;
  }
  html body header .custom-logo,
  html body header .site-logo img,
  html body header .logo img {
    max-height: 28px !important;
    width: auto !important;
  }

  html body header nav ul,
  html body header .menu,
  html body header .wp-block-navigation__container {
    gap: 4px 12px !important;
  }
  html body header nav a,
  html body header .menu a,
  html body header .wp-block-navigation-item__content {
    font-size: 10px !important;
    letter-spacing: 1px !important;
    padding: 2px 0 !important;
  }

  html body header .header-cta a,
  html body header .cta-button,
  html body header .wp-block-button__link,
  html body header a.button,
  html body header a[href*="quote"] {
    font-size: 10px !important;
    letter-spacing: 1px !important;
    padding: 8px 14px !important;
    min-height: 0 !important;
    line-height: 1.4 !important;
    width: auto !important;
  }
}

@media (max-width: 480px) {
  html body header nav a,
  html body header .menu a,
  html body header .wp-block-navigation-item__content {
    font-size: 9px !important;
  }
  html body header .header-cta a,
  html body header .cta-button,
  html body header .wp-block-button__link,
  html body header a.button,
  html body header a[href*="quote"] {
    font-size: 9px !important;
    padding: 7px 12px !important;
  }
}

/* 8. Blog pages only: hide Gallery, FAQs and About from the menu */
body.single-post header li:has(> a[href*="gallery" i]),
body.single-post header li:has(> a[href*="faq" i]),
body.single-post header li:has(> a[href*="about" i]),
body.blog header li:has(> a[href*="gallery" i]),
body.blog header li:has(> a[href*="faq" i]),
body.blog header li:has(> a[href*="about" i]),
body.archive header li:has(> a[href*="gallery" i]),
body.archive header li:has(> a[href*="faq" i]),
body.archive header li:has(> a[href*="about" i]),
body.category header li:has(> a[href*="gallery" i]),
body.category header li:has(> a[href*="faq" i]),
body.category header li:has(> a[href*="about" i]),
body[class*="blog"] header li:has(> a[href*="gallery" i]),
body[class*="blog"] header li:has(> a[href*="faq" i]),
body[class*="blog"] header li:has(> a[href*="about" i]),
body.single-post header nav a[href*="gallery" i],
body.single-post header nav a[href*="faq" i],
body.single-post header nav a[href*="about" i],
body.blog header nav a[href*="gallery" i],
body.blog header nav a[href*="faq" i],
body.blog header nav a[href*="about" i],
body.archive header nav a[href*="gallery" i],
body.archive header nav a[href*="faq" i],
body.archive header nav a[href*="about" i],
body.category header nav a[href*="gallery" i],
body.category header nav a[href*="faq" i],
body.category header nav a[href*="about" i],
body[class*="blog"] header nav a[href*="gallery" i],
body[class*="blog"] header nav a[href*="faq" i],
body[class*="blog"] header nav a[href*="about" i] {
  display: none !important;
}
