/* =========================================
   CKS BUILDTECH HEADER
========================================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 88px;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  color: var(--white);

  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    backdrop-filter 0.35s ease;
}

/* =========================================
   HEADER INNER
========================================= */

.header-inner {
  width: min(1500px, calc(100% - 70px));
  height: 100%;
  margin: auto;

  display: flex;
  align-items: center;

  /* Logo LEFT — everything else RIGHT */
  justify-content: space-between;
}

/* =========================================
   LOGO
========================================= */

.brand {
  display: flex;
  align-items: center;

  flex-shrink: 0;
}

.brand img {
  display: block;

  width: auto;
  height: 58px;

  object-fit: contain;
}

/* =========================================
   RIGHT SIDE
========================================= */

.main-nav {
  display: flex;
  align-items: center;

  gap: 38px;

  margin-left: auto;
}

.main-nav a {
  position: relative;

  font-size: 14px;
  font-weight: 600;

  letter-spacing: 0.07em;

  color: rgba(255, 255, 255, 0.82);

  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}

/* Small yellow hover line */

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: var(--yellow);
  transition: width 0.3s ease;
}

.main-nav a:hover {
  color: var(--white);
}

.main-nav a:hover::after {
  width: 100%;
}

/* =========================================
   ENQUIRE BUTTON
========================================= */

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-left: 40px;
  min-height: 44px;
  padding: 0 20px;
  background: var(--yellow);
  color: var(--black);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}

.header-cta span {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.header-cta:hover {
  background: var(--white);
  transform: translateY(-1px);
}

.header-cta:hover span {
  transform: translate(3px, -3px);
}

/* =========================================
   SCROLLED HEADER
========================================= */

.site-header.scrolled {
  background: rgba(13, 14, 13, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* =========================================
   MOBILE MENU BUTTON
========================================= */

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;

  width: 18px;
  height: 1px;

  margin: 0 auto;

  background: var(--white);

  transition: 0.3s ease;
}

/* =========================================
   MOBILE NAV
========================================= */

.mobile-menu {
  position: fixed;

  top: 88px;
  left: 0;

  width: 100%;
  height: calc(100vh - 88px);

  z-index: 900;

  display: block;

  padding: 30px;
  overflow: hidden;

  background: rgba(42, 43, 41, 0.98);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  transform: translateY(-110%);

  transition: transform 0.4s ease;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu nav a {
  padding: 18px 0;

  border-bottom: 1px solid rgba(255, 255, 255, 0.1);

  color: var(--white);

  font-family: var(--font-display);

  font-size: 23px;
}

.mobile-menu-cta {
  margin-top: 25px;

  padding: 16px 20px !important;

  background: var(--yellow);

  color: var(--black) !important;

  text-align: center;
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 1150px) {
  .main-nav {
    gap: 24px;
  }

  .header-cta {
    margin-left: 25px;
  }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 900px) {
  .header-inner {
    width: calc(100% - 40px);
  }

  .main-nav,
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 500px) {
  .site-header {
    height: 76px;
  }

  .brand img {
    height: 48px;
  }

  .mobile-menu {
    top: 76px;
    height: calc(100vh - 76px);
  }
}

/* =========================================
   DESKTOP DROPDOWN
========================================= */

.nav-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
  color: var(--white);
}

.dropdown-arrow {
  font-size: 17px;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: -20px;
  min-width: 250px;
  padding: 12px 0;
  background: rgba(32, 33, 31, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid var(--yellow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: 0.3s ease;
  z-index: 1100;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav .dropdown-menu a {
  display: block;
  padding: 13px 20px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
}

.main-nav .dropdown-menu a::after {
  display: none;
}

.main-nav .dropdown-menu a:hover {
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.05);
}

/* =========================================
   MOBILE DROPDOWN
========================================= */

.mobile-dropdown {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-dropdown-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  background: transparent;
  border: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 23px;
  text-align: left;
  cursor: pointer;
}

.mobile-dropdown-toggle span {
  color: var(--yellow);
  font-size: 20px;
}

.mobile-submenu {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.3s ease,
    opacity 0.3s ease;
}

.mobile-dropdown.open .mobile-submenu {
  grid-template-rows: 1fr;
  opacity: 1;
}

.mobile-submenu a {
  overflow: hidden;
  padding: 0 0 0 18px !important;
  border: 0 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-family: var(--font-body, inherit);
  font-size: 15px !important;
  transition: padding 0.3s ease;
}

.mobile-dropdown.open .mobile-submenu a {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* =========================================
   MOBILE MENU IMPROVEMENTS
========================================= */

@media (max-width: 900px) {
  .mobile-menu {
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-menu.active {
    visibility: visible;
    pointer-events: auto;
  }

  body.menu-open {
    overflow: hidden;
  }

  .menu-toggle.active span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .menu-toggle.active span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }
}



/* =========================================
   FIX DESKTOP NAVIGATION OVERLAP
   Add at the VERY END of header.css
========================================= */

@media (min-width: 901px) {

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 25px;
    }

    .brand {
        flex: 0 0 auto;
    }

    .main-nav {
        display: flex;
        flex: 0 1 auto;
        align-items: center;
        justify-content: flex-end;
        gap: clamp(18px, 2vw, 32px);
        margin-left: auto;
        white-space: nowrap;
    }

    /* Keep only main navigation items in the horizontal row */
    .main-nav > a,
    .main-nav > .nav-dropdown {
        flex: 0 0 auto;
    }

    .nav-dropdown {
        position: relative;
        height: auto;
        display: flex;
        align-items: center;
    }

    .nav-dropdown-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        padding: 15px 0;
        color: rgba(255, 255, 255, 0.85);
        background: transparent;
        border: 0;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.04em;
        cursor: pointer;
    }

    /* Dropdown panel */
    .main-nav .dropdown-menu {
        display: block !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;

        width: 270px;
        min-width: 270px;
        padding: 8px 0;

        flex-direction: column !important;
        align-items: stretch !important;

        background: #252624;
        border: 1px solid rgba(255,255,255,0.12);
        border-top: 2px solid #f3c308;
        box-shadow: 0 15px 35px rgba(0,0,0,0.25);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(10px);
        transition: opacity 0.25s ease, transform 0.25s ease,
                    visibility 0.25s ease;

        z-index: 1100;
    }

    /* Show dropdown */
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu,
    .nav-dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Submenu links must stack vertically */
    .main-nav .dropdown-menu a {
        display: block !important;
        width: 100%;
        padding: 13px 18px;
        white-space: normal;
        font-size: 13px;
        letter-spacing: 0.02em;
        line-height: 1.5;
        color: rgba(255,255,255,0.82);
    }

    .main-nav .dropdown-menu a::after {
        display: none !important;
    }

    .main-nav .dropdown-menu a:hover {
        color: #f3c308;
        background: rgba(255,255,255,0.06);
    }

    .header-cta {
        flex: 0 0 auto;
        margin-left: 0;
        white-space: nowrap;
    }
}

/* Switch to mobile menu before desktop header gets cramped */
@media (min-width: 901px) and (max-width: 1150px) {
    .main-nav {
        gap: 15px;
    }

    .brand img {
        height: 50px;
    }

    .main-nav > a,
    .nav-dropdown-toggle {
        font-size: 12px;
    }

    .header-cta {
        padding: 0 13px;
        font-size: 11px;
    }
}
