/**
 * Sunset Sleepers Retaining Wall Calculator header
 *
 * Load this file AFTER Pico and style/index_3.css.
 * It restyles the calculator's existing .nav-background / .topnav markup
 * to match Elementor header template 21906 used on /quote-request/.
 */

:root {
  --ss-header-yellow: #202124;
  --ss-header-dark: #202124;
  --ss-header-border: #45494f;
  --ss-header-white: #ffffff;
  --ss-header-hover: #e17538;
  --ss-header-muted: #bdc1c6;
  --ss-header-content-width:1040px;
}

/* Full-width yellow strip behind the rounded dark header. */
.nav-background {
  width: 100%;
  padding: 10px 0 0;
  background: #202124;
}

/* Reset Pico's nav layout, then recreate the Elementor header grid. */
.nav-background .topnav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(100%, var(--ss-header-content-width));
  min-height: 102px;
  margin: 0 auto;
  padding: 10px 30px;
  color: var(--ss-header-white);
  background: var(--ss-header-dark);
  border: 0;
  border-bottom: 1px solid var(--ss-header-border);
  border-radius: 50px 50px 0 0;
  box-shadow: none;
  font-family: sans-serif;
  font-size: 15px;
}

.nav-background .topnav,
.nav-background .topnav * {
  box-sizing: border-box;
}

.nav-background .topnav > ul {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-background .topnav > ul:first-child {
  grid-column: 1;
  justify-content: flex-start;
}

.nav-background .topnav > ul:nth-child(2) {
  grid-column: 2;
  justify-content: center;
}

.nav-background .topnav > ul:last-child {
  grid-column: 3;
  justify-content: flex-end;
  gap: 22px;
}

.nav-background .topnav li,
.nav-background .topnav > ul:nth-child(2) > div {
  margin: 0;
  padding: 0;
}

/* Recreate the non-clickable "Need help?" label from the Elementor header. */
.nav-background .topnav > ul:last-child::before {
  flex: 0 0 auto;
  color: var(--ss-header-white);
  content: "Need help?";
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

/* Remove Pico's button-like link treatment inside this header only. */
.nav-background .topnav a,
.nav-background .topnav a.secondary,
.nav-background .topnav a[role="button"] {
  --pico-color: var(--ss-header-white);
  --pico-secondary: var(--ss-header-white);
  --pico-secondary-hover: var(--ss-header-hover);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--ss-header-white);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.nav-background .topnav > ul:first-child a {
  font-size: 15px;
  font-weight: 600;
}

.nav-background .topnav > ul:first-child a strong {
  display: inline-block;
  color: currentColor;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: transform 180ms ease;
}

.nav-background .topnav a:hover,
.nav-background .topnav a.secondary:hover,
.nav-background .topnav a:focus-visible {
  color: var(--ss-header-hover);
  background: transparent;
  border-color: transparent;
  text-decoration: none;
}

.nav-background .topnav > ul:first-child a:hover strong {
  transform: translateX(-3px);
}

.nav-background .topnav a:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--ss-header-yellow);
  outline-offset: 5px;
}

/* Use the same logo asset as the Elementor header. */
.nav-background .topnav .logo {
  display: block;
  width: 100px;
  max-width: none;
  height: auto;
  margin: 0 auto;
  content: url("https://www.sunsetsleepers.com.au/wp-content/uploads/2023/11/sunset-sleepers-logo.webp");
  transition: transform 180ms ease;
}

.nav-background .topnav a:hover .logo {
  transform: scale(1.04);
}

/* LiveChat and phone icons. */
.nav-background .topnav .elementor-icon-list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  color: var(--ss-header-yellow);
}

.nav-background .topnav .elementor-icon-list-icon svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.nav-background .topnav a:hover .elementor-icon-list-icon,
.nav-background .topnav a:focus-visible .elementor-icon-list-icon {
  color: var(--ss-header-hover);
}

/* The Elementor header already supplies its own 1px lower border. */
.nav-background + hr {
  display: none;
}

/* Tablet: the original template removes "Need help?" but retains both links. */
@media (max-width: 1024px) {
  .nav-background .topnav {
    min-height: 92px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .nav-background .topnav > ul:last-child {
    gap: 18px;
  }

  .nav-background .topnav > ul:last-child::before {
    display: none;
  }

  .nav-background .topnav .logo {
    width: 90px;
  }
}

/* Mobile: keep Back to Products and the centred logo, as Elementor does. */
@media (max-width: 767px) {
  .nav-background {
    padding-top: 10px;
  }

  .nav-background .topnav {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    min-height: 78px;
    padding: 10px 20px;
    border-radius: 34px 34px 0 0;
  }

  .nav-background .topnav > ul:last-child {
    display: none;
  }

  .nav-background .topnav > ul:first-child a {
    gap: 6px;
    font-size: 14px;
    line-height: 1.1;
    white-space: normal;
  }

  .nav-background .topnav > ul:first-child a strong {
    font-size: 18px;
  }

  .nav-background .topnav .logo {
    width: 68px;
  }
}

@media (max-width: 390px) {
  .nav-background .topnav {
    padding-right: 15px;
    padding-left: 15px;
  }

  .nav-background .topnav > ul:first-child a {
    max-width: 94px;
    font-size: 13px;
  }

  .nav-background .topnav .logo {
    width: 62px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-background .topnav .logo,
  .nav-background .topnav > ul:first-child a strong {
    transition: none;
  }
}
