/* ==========================================================
   Header & Navigation refinements (loaded after main.css)
   ========================================================== */

/* ---------- Anchor targets: keep headings clear of the sticky header ---------- */
section[id],
#video,
#contact-info,
#get-quote,
#footer {
  scroll-margin-top: 72px;
}

/* ---------- Header bar ---------- */
.ct-header-area {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.ct-header-area.header-sticky {
  background-color: rgba(23, 23, 23, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ct-header-logo img,
.ct-header-area .header-logo img {
  transition: transform 0.3s ease;
}

.ct-header-area.header-sticky .header-logo img {
  transform: scale(0.9);
  transform-origin: left center;
}

/* ---------- Desktop menu ---------- */
.ct-main-menu {
  padding-left: 0;
}

.ct-main-menu nav > ul > li > a {
  position: relative;
  transition: color 0.25s ease, padding 0.3s ease;
}

/* animated underline for top-level items */
.ct-main-menu nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  height: 2px;
  border-radius: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease, bottom 0.3s ease;
}

.ct-main-menu nav > ul > li:hover > a::after,
.ct-main-menu nav > ul > li.active > a::after {
  transform: scaleX(1);
}

.ct-main-menu nav > ul > li.active > a {
  color: var(--yellow);
}

/* compact menu while the header is sticky */
.header-sticky .ct-main-menu nav > ul > li > a {
  padding: 22px 0;
}

.header-sticky .ct-main-menu nav > ul > li > a::after {
  bottom: 12px;
}

.header-sticky .sidebar__toggle {
  padding: 22px 0;
}

/* chevron flips when the dropdown is open */
.ct-main-menu nav > ul > li > a i {
  font-size: 12px;
  transition: transform 0.25s ease;
}

.ct-main-menu nav > ul > li:hover > a i {
  transform: rotate(180deg);
}

/* ---------- Dropdown ---------- */
.ct-main-menu ul li .sub-menu {
  width: 230px;
  top: 100%;
  margin-top: 8px;
  border-top: 2px solid var(--yellow);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* invisible bridge so the dropdown does not close when the mouse crosses the gap */
.ct-main-menu ul li .sub-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.ct-main-menu ul li:hover .sub-menu {
  transform: translateY(0);
}

.ct-main-menu ul li .sub-menu li:last-child {
  border-bottom: 0;
}

.ct-main-menu ul li .sub-menu li a {
  font-size: 15px;
  line-height: 24px;
  padding: 12px 24px;
  transition: padding-left 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.ct-main-menu ul li .sub-menu li:hover > a {
  padding-left: 30px;
}

.ct-main-menu ul li .sub-menu li.active > a {
  color: var(--theme);
  font-weight: 600;
  background: rgba(238, 251, 19, 0.35);
}

.ct-main-menu ul li .sub-menu li.active:hover > a {
  color: var(--white);
  background: transparent;
}

/* ---------- Header button ---------- */
.ct-header-button .ct-btn {
  white-space: nowrap;
}

/* ---------- Keyboard focus ---------- */
.ct-main-menu a:focus-visible,
.mobile-menu a:focus-visible,
.header-logo:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Mid-size desktops: keep the menu on one line ---------- */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .ct-main-menu ul li {
    margin: 0 9px;
  }

  .ct-main-menu ul li a {
    font-size: 14px;
  }

  .ct-header-button .ct-btn {
    padding-left: 22px;
    padding-right: 22px;
  }
}

/* ---------- Mobile / tablet (hamburger + off-canvas menu) ---------- */
@media (max-width: 1199.98px) {
  .header-sticky .sidebar__toggle {
    padding: 22px 0;
  }

  .mobile-menu a.active,
  .mobile-menu li.active > a:not(.mean-expand) {
    color: var(--yellow) !important;
  }
}
