/* Site Header */
.tfes-site-header {
  width: 100%;
  box-sizing: border-box;
  background-color: #5C3CD3;
  color: #fff;
  position: relative;
  z-index: 100;
  overflow: visible !important;
}

.tfes-site-header *,
.tfes-site-header *::before,
.tfes-site-header *::after { box-sizing: border-box; }

.tfes-site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  overflow: visible !important;
}

.tfes-site-header__logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.tfes-site-header__logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.tfes-site-header__nav--desktop {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible !important;
}

.tfes-site-header__menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: visible !important;
}

.tfes-site-header__menu li {
  margin: 0;
  position: relative;
  list-style: none;
  flex: 0 0 auto;
}

.tfes-site-header__menu > .menu-item-has-children {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tfes-site-header__menu a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  color: #fff !important;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  border-bottom: 1.5px solid transparent;
  white-space: nowrap;
}

.tfes-site-header__menu .current-menu-item > a,
.tfes-site-header__menu a:hover,
.tfes-site-header__menu a:focus {
  border-bottom-color: currentColor;
}

/* Chevron for parents with submenu */
.tfes-site-header__chevron {
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-top: -2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.tfes-site-header__menu > .menu-item-has-children.is-open > a .tfes-site-header__chevron,
.tfes-site-header__menu > .menu-item-has-children.is-open > .tfes-site-header__submenu-toggle .tfes-site-header__chevron,
.tfes-site-header__menu > .menu-item-has-children:hover > a .tfes-site-header__chevron,
.tfes-site-header__menu > .menu-item-has-children:focus-within > a .tfes-site-header__chevron {
  transform: rotate(225deg);
  margin-top: 2px;
}

/* Desktop: hide the extra toggle button (chevron lives in the link) */
.tfes-site-header__nav--desktop .tfes-site-header__submenu-toggle {
  display: none !important;
}

/* Dropdown panel */
.tfes-site-header__menu .sub-menu {
  display: none !important;
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  min-width: 200px;
  margin: 0 !important;
  padding: 10px 0 !important;
  list-style: none !important;
  background: #4b2e9b !important;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.22);
  z-index: 999 !important;
}

/* Hover bridge so the cursor can reach the panel */
.tfes-site-header__menu .sub-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.tfes-site-header__menu > .menu-item-has-children:hover > .sub-menu,
.tfes-site-header__menu > .menu-item-has-children:focus-within > .sub-menu,
.tfes-site-header__menu > .menu-item-has-children.is-open > .sub-menu {
  display: block !important;
}

.tfes-site-header__menu .sub-menu a {
  display: block;
  width: 100%;
  padding: 10px 16px !important;
  white-space: nowrap;
  border-bottom: 0 !important;
  color: #fff !important;
}

.tfes-site-header__menu .sub-menu a:hover,
.tfes-site-header__menu .sub-menu a:focus {
  background: rgba(255, 255, 255, 0.1);
}

.tfes-site-header__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.tfes-site-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px !important;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
}

.tfes-site-header__btn--ghost {
  color: #fff !important;
  background: transparent !important;
  border: 1.5px solid #fff !important;
}

.tfes-site-header__btn--solid {
  color: #000 !important;
  background-color: #fff !important;
  border: 1.5px solid #fff !important;
}

.tfes-site-header__toggle,
.tfes-site-header__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff !important;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.tfes-site-header__panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  flex-direction: column;
  padding: 20px 22px 28px;
  background-color: #5C3CD3;
  overflow: auto;
}

.tfes-site-header.is-open .tfes-site-header__panel {
  display: flex;
}

.tfes-site-header__panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.tfes-site-header__menu--mobile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.tfes-site-header__menu--mobile > li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  display: block;
}

.tfes-site-header__menu--mobile > .menu-item-has-children {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.tfes-site-header__menu--mobile > .menu-item-has-children > a {
  grid-column: 1;
  grid-row: 1;
}

.tfes-site-header__menu--mobile > .menu-item-has-children > .tfes-site-header__submenu-toggle {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff !important;
  cursor: pointer;
}

/* Hide in-link chevron on mobile; use the toggle button instead */
.tfes-site-header__menu--mobile > .menu-item-has-children > a .tfes-site-header__chevron {
  display: none;
}

.tfes-site-header__menu--mobile > li > a {
  display: block;
  padding: 16px 0;
  font-size: 22px;
  font-weight: 600;
  border-bottom: 0 !important;
}

.tfes-site-header__menu--mobile .sub-menu {
  display: none !important;
  position: static !important;
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0 !important;
  padding: 0 0 12px 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
}

.tfes-site-header__menu--mobile .sub-menu::before {
  display: none;
}

.tfes-site-header__menu--mobile > .menu-item-has-children.is-open > .sub-menu {
  display: block !important;
}

.tfes-site-header__menu--mobile .sub-menu a {
  padding: 10px 0 !important;
  font-size: 16px;
  font-weight: 500;
  white-space: normal;
}

.tfes-site-header__actions--mobile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
}

.tfes-site-header__actions--mobile .tfes-site-header__btn {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
}

/* Compact spacing on small / mid laptops so the full menu stays on one line. */
@media (max-width: 1360px) {
  .tfes-site-header__bar {
    gap: 12px;
  }

  .tfes-site-header__logo-img {
    height: 40px;
    max-width: 120px;
  }

  .tfes-site-header__menu {
    gap: 4px 12px;
  }

  .tfes-site-header__menu a {
    font-size: 13px;
  }

  .tfes-site-header__btn {
    padding: 9px 12px;
    font-size: 11px;
  }
}

@media (max-width: 1200px) {
  .tfes-site-header__bar {
    gap: 10px;
  }

  .tfes-site-header__menu {
    gap: 2px 8px;
  }

  .tfes-site-header__menu a {
    font-size: 12px;
    gap: 4px;
  }

  .tfes-site-header__logo-img {
    height: 36px;
    max-width: 108px;
  }

  .tfes-site-header__btn {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* Tablet / small screens: collapse to hamburger. */
@media (max-width: 1024px) {
  html body .elementor-widget.elementor-widget-tfes_site_header .elementor-widget-container header.tfes-site-header,
  html body .elementor-element.elementor-widget-tfes_site_header .tfes-site-header[data-tfes-header],
  .tfes-site-header {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .tfes-site-header__bar {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .tfes-site-header__nav--desktop,
  .tfes-site-header__actions--desktop { display: none; }

  .tfes-site-header__toggle {
    display: inline-flex;
  }

  .tfes-site-header__close {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  html body .elementor-widget.elementor-widget-tfes_site_header .elementor-widget-container header.tfes-site-header,
  html body .elementor-element.elementor-widget-tfes_site_header .tfes-site-header[data-tfes-header],
  .tfes-site-header {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .tfes-site-header__bar {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .tfes-site-header__logo-img {
    height: 40px;
    max-width: 140px;
  }
}
