.flex { display: flex; }
.col { flex-direction: column; }
.center { justify-content: center; align-items: center; }

.hd-sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.hd-main-container {
  z-index: 100;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
}

.hd-main-container * { box-sizing: border-box; }

.hd-header-container { flex-direction: column; }

.hd-header {
  justify-content: space-between;
  align-items: center;
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 18px;
  position: static;
}

.hd-header-cta {
  border: 2px solid;
  border-radius: 100px;
  padding: 6px 20px;
  transition: .3s ease;
  text-decoration: none;
}

.hd-navigation-end { gap: 24px; }
.hd-flags { gap: 12px; }
.hd-flags img { height: 21px; border: 1px solid white; }
.hd-top-nav { gap: 48px; }

.hd-mobile-toggle,
.hd-mobile-panel {
  display: none;
}

.hd-mobile-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  color: #ffffff;
}

.hd-mobile-toggle-icon {
  display: block;
  position: relative;
  width: 24px;
  height: 18px;
}

.hd-mobile-toggle-icon::before,
.hd-mobile-toggle-icon::after,
.hd-mobile-toggle-icon span {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hd-mobile-toggle-icon::before { top: 0; }
.hd-mobile-toggle-icon::after { bottom: 0; }
.hd-mobile-toggle-icon span { top: 8px; }

.hd-header-container.is-mobile-open .hd-mobile-toggle-icon::before {
  transform: translateY(8px) rotate(45deg);
}

.hd-header-container.is-mobile-open .hd-mobile-toggle-icon::after {
  transform: translateY(-8px) rotate(-45deg);
}

.hd-header-container.is-mobile-open .hd-mobile-toggle-icon span {
  opacity: 0;
}

.hd-nav-item-wrapper {
  position: static;
  display: flex;
  align-items: center;
  padding-bottom: 8px;
  transition: .3s ease;
  cursor: pointer;
  margin-top: 8px;
}

.hd-top-nav .hd-top-nav-link {
  text-decoration: none;
  font-weight: 600;
  transition: .3s ease;
  font-family:'GTSectra';
}

/* only show top-level caret when item has children */
.hd-top-nav .hd-nav-item-wrapper::after {
  content: none;
}

.hd-top-nav .hd-nav-item-wrapper.has-children::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 12px;
  margin-top: -2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  color: inherit;
  flex: 0 0 auto;
}

.hd-nav-item-wrapper.has-children:hover::after {
  transform: rotate(-135deg);
}

.hd-mega-menu-container {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 90;
  display: grid;
  grid-template-columns: 1fr minmax(auto, 335px) minmax(auto, 1005px) 1fr;
}

.hd-nav-item-wrapper:hover .hd-mega-menu-container {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hd-mm-promo-sidebar {
  grid-column: 1 / 3;
  display: flex;
  justify-content: flex-end;
  padding: 50px 30px 50px 18px;
}

.hd-mm-promo-wrapper {
  width: 100%;
  max-width: 335px;
}

.hd-promo-headline {
  font-size: 32px;
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.hd-promo-desc {
  margin-bottom: 25px;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.8;
}

.hd-promo-btn {
  display: inline-block;
  text-decoration: none;
  border: 1px solid #FF5C35;
  color: #FF5C35;
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.hd-promo-btn:hover {
  background-color: #FF5C35;
  color: #FFF;
}

.hd-mm-content-wrapper {
  grid-column: 3 / 4;
  display: flex;
  padding: 40px 0 40px 40px;
  margin: 40px 40px 40px 0;
  background-color: rgba(1,18,30,0.4);
  border: 1px solid #A7A7A7;
  border-radius: 5px;
}

.hd-mm-tabs-column {
  width: 25%;
  padding-right: 40px;
}

.hd-tab-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  text-align: left;
  padding: 12px 0;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: GTSectra;
  font-size: 20px;
  font-weight: 700;
}

.hd-tab-arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateX(-10px);
  opacity: 0;
  transition: all 0.3s ease;
  flex: 0 0 auto;
}

.hd-tab-trigger:hover .hd-tab-arrow {
  opacity: 1;
  transform: rotate(-45deg) translateX(0);
}

.hd-tab-trigger.active .hd-tab-arrow {
  opacity: 1;
  transform: rotate(-45deg) translateX(0);
}

.hd-mm-links-column {
  width: 75%;
}

.hd-tab-pane { display: none; }
.hd-tab-pane.active { display: block; }

.hd-links-grid {
  display: flex;
  gap: 40px;
  padding-right: 40px;
}

.hd-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 220px;
}

.hd-mega-link-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2px solid transparent;
  padding-bottom: 12px;
  transition: border-color 0.3s ease;
}

.hd-mega-link-item:hover { border-bottom-color: #FF5C35; }

.hd-link-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hd-link-title {
  font-size: 16px;
  font-weight: 400;
}

.hd-link-arrow {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateX(-10px);
  opacity: 0;
  transition: all 0.3s ease;
  flex: 0 0 auto;
  color: #FFFFFF;
}

.hd-mega-link-item:hover .hd-link-arrow {
  opacity: 1;
  transform: rotate(-45deg) translateX(0);
}

.hd-link-desc {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .hd-header {
    padding: 18px 16px;
  }

  .hd-top-nav,
  .hd-navigation-end {
    display: none;
  }

  .hd-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .hd-mega-menu-container {
    display: block;
    height: auto;
    overflow-y: auto;
    max-height: 80vh;
  }

  .hd-mm-promo-sidebar {
    grid-column: auto;
    width: 100%;
    justify-content: flex-start;
    padding: 30px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .hd-mm-content-wrapper {
    grid-column: auto;
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: none;
    padding: 30px;
  }
  
  .hd-mm-tabs-column,
  .hd-mm-links-column {
    width: 100%;
  }
  
  .hd-mm-content-wrapper {
    flex-direction: column;
    gap: 30px;
  }
}

@media (max-width: 767px) {
  .hd-header {
    padding: 14px 16px;
  }

  .hd-mm-promo-sidebar {
    display: none !important;
  }

  .hd-mm-content-wrapper {
    padding: 20px;
  }

  .hd-links-grid {
    flex-direction: column;
    gap: 30px;
  }
}

@media (max-width: 1024px) {
  .hd-mobile-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 110;
    display: block;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .hd-mobile-panel.is-open {
    pointer-events: auto;
    opacity: 1;
  }

  .hd-mobile-panel-inner {
    position: relative;
    width: 100%;
    background: rgba(1, 33, 56, 0.2);
    border-radius: 10px;
    padding: 40px 16px;
    backdrop-filter: blur(30px);
    overflow: hidden;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
  }

  .hd-mobile-panel-body {
    display: flex;
    flex-direction: column;
    gap: 40px;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 4px;
  }

  .hd-mobile-links {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  .hd-mobile-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .hd-mobile-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
  }

  .hd-mobile-item-label {
    font-size: 18px;
    line-height: 1.3;
    color: #ffffff;
    text-decoration: none;
  }

  .hd-mobile-caret {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .hd-mobile-item-panel {
    display: none;
    border-top: 2px solid #ff5c35;
    padding-top: 20px;
  }

  .hd-mobile-item-panel.is-open {
    display: block;
  }

  .hd-mobile-item .hd-mobile-item-row[aria-expanded="true"] .hd-mobile-caret {
    transform: rotate(-135deg);
  }

  .hd-mobile-subnav {
    background: rgba(1, 18, 30, 0.39);
    border: 1px solid #a7a7a7;
    border-radius: 5px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .hd-mobile-subsection {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .hd-mobile-subsection-trigger {
    background: transparent;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 0 8px 0;
    border-bottom: 2px solid transparent;
  }

  .hd-mobile-subsection.active .hd-mobile-subsection-trigger {
    border-bottom-color: #ff5c35;
  }

  .hd-mobile-subsection.active .hd-mobile-subsection-trigger .hd-mobile-caret {
    transform: rotate(-135deg);
  }

  .hd-mobile-subsection-panel {
    display: none;
    padding-left: 20px;
    gap: 25px;
    flex-direction: column;
  }

  .hd-mobile-subsection.active .hd-mobile-subsection-panel {
    display: flex;
  }

  .hd-mobile-link {
    text-decoration: none;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .hd-mobile-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .hd-mobile-link-title {
    font-size: 16px;
  }

  .hd-mobile-link-caret {
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
  }

  .hd-mobile-link-desc {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.9;
  }

  .hd-mobile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
  }

  .hd-mobile-cta {
    border: 2px solid #ffffff;
    border-radius: 100px;
    padding: 8px 18px;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
  }

  .hd-mobile-footer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .hd-mobile-search {
    color: #ffffff;
    display: flex;
    align-items: center;
  }

  .hd-mobile-flags {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hd-mobile-flags img {
    height: 20px;
    border: 1px solid #ffffff;
  }
}

/* ---------- Desktop mega-menu fixes (2026-09) ---------- */
@media (min-width: 1025px) {

  /* Hover bridge: closes the ~31px gap between the nav item's hover box and
     the top of the panel (.hd-header padding-bottom). The panel is a DOM
     descendant of .hd-nav-item-wrapper, so hovering this pseudo keeps :hover
     true. It is only hit-testable once the panel is visible (the closed state
     is visibility: hidden), so it never blocks the header. */
  .hd-mega-menu-container::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(-1 * var(--hd-mm-bridge, 32px));
    height: var(--hd-mm-bridge, 32px);
  }

  /* Cap the panel to the viewport and scroll the links column only.
     --hd-header-height is set in module.html; 102px is the fallback.
     80px = .hd-mm-content-wrapper's 40px top + 40px bottom margins. */
  .hd-mm-content-wrapper {
    max-height: calc(100dvh - var(--hd-header-height, 102px) - 80px);
    overflow: hidden;
  }

  .hd-mm-links-column {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }

  .hd-mm-links-column::-webkit-scrollbar { width: 6px; }
  .hd-mm-links-column::-webkit-scrollbar-track { background: transparent; }

  .hd-mm-links-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
  }

  .hd-mm-links-column::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.55);
  }

  /* Row-align link titles across columns via subgrid. --hd-cols / --hd-rows
     are set per .hd-links-grid in module.html. Falls back to the flex layout
     above where subgrid is unsupported. */
  @supports (grid-template-rows: subgrid) {
    .hd-links-grid {
      display: grid;
      grid-template-columns: repeat(var(--hd-cols, 2), minmax(0, 1fr));
      grid-template-rows: repeat(var(--hd-rows, 1), auto);
      gap: 18px 40px;
      align-content: start;
    }

    .hd-column {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: 1 / -1;
    }
  }
}
