/* ══════════════════════════════════════════════════════════
   Rise Training Club — Header
   Source: Elementor template 70.json
   Breakpoints: Desktop >1280 | Laptop 1025-1280 | Tablet 768-1024 | Mobile <768
   ══════════════════════════════════════════════════════════ */

.header {
  /* Shared content inset — header__inner padding AND the top-bar notch anchor */
  --edge: max(80px, calc(50vw - 640px));
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--color-white);
  transition: transform 0.3s ease;
}

/* Top bar — CSS-drawn navy band with an angled left notch (fully responsive).
   Replaces the old scaling raster (Group-1-1-scaled.png), whose fixed aspect
   ratio let the band drift off the text at some widths. */
.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  background-color: #041628;
  clip-path: polygon(
    calc(var(--edge) + 170px) 0,
    100% 0,
    100% 100%,
    calc(var(--edge) + 216px) 100%
  );
  z-index: 0;
  pointer-events: none;
}

.header--hidden {
  transform: translateY(-100%);
}

.header__inner {
  position: relative;
  z-index: 1;
  padding-top: 0;
  padding-bottom: 16px;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

/* ── Top Bar ── */
.header__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 46px;
  padding-top: 0;
  /* Keep text/icons to the right of the angled notch (matches --edge + 216px) */
  padding-left: 232px;
}

.header__topbar-left {
  display: flex;
  align-items: center;
  gap: 36px;
}

.header__topbar-left a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: var(--font-size-nav);
  line-height: var(--line-height-nav);
  color: var(--color-secondary);
  transition: color var(--transition-base);
}

.header__topbar-left a:hover {
  color: var(--color-white);
}

.header__topbar-left .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-secondary);
  transition: color var(--transition-base);
}

.header__topbar-left a:hover .icon {
  color: var(--color-white);
}

.header__topbar-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

.header__topbar-right a {
  display: inline-flex;
  color: var(--color-white);
  transition: color var(--transition-base);
}

.header__topbar-right a:hover {
  color: var(--color-secondary);
}

.header__topbar-right svg {
  width: 20px;
  height: 20px;
}

/* ── Main Nav Row ── */
.header__main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
}

/* ── Logo ── */
.header__logo {
  flex-shrink: 0;
}

.header__logo img {
  height: var(--header-logo-height);
  width: auto;
  object-fit: contain;
}

/* ── Desktop Nav ── */
.header__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__menu-item {
  position: relative;
}

.header__menu-item > a {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-nav);
  line-height: var(--line-height-nav);
  text-transform: capitalize;
  padding: 10px 6px;
  color: var(--color-accent);
  transition: color var(--transition-base);
  white-space: nowrap;
}

.header__menu-item > a:hover {
  color: var(--color-secondary);
}

/* ── Dropdown ── */
.header__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: max-content;
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 4px 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  z-index: 10;
  list-style: none;
}

.nav-dropdown-toggle:hover > .header__dropdown,
.nav-dropdown-toggle.is-open > .header__dropdown {
  display: block;
}

.header__dropdown li a {
  display: block;
  font-family: var(--font-body);
  font-size: var(--font-size-nav);
  font-weight: var(--font-weight-nav);
  line-height: var(--line-height-accent);
  padding: 12px 20px;
  white-space: nowrap;
  color: var(--color-text);
  transition: background-color var(--transition-base), color var(--transition-base);
}

.header__dropdown li:first-child a { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.header__dropdown li:last-child a { border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

.header__dropdown li a:hover {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

/* ── Right Actions ── */
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.header__login {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-nav);
  text-transform: capitalize;
  color: var(--color-text);
  transition: color var(--transition-base);
}

.header__login:hover {
  color: var(--color-secondary);
}

/* ── Hamburger ── */
.header__hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.header__hamburger img {
  width: 32px;
  height: 32px;
}

/* ── Off-Canvas ── */
.off-canvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background-color: var(--color-white);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
}

.off-canvas.is-open {
  transform: translateX(0);
}

.off-canvas__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.off-canvas.is-open ~ .off-canvas__overlay {
  opacity: 1;
  pointer-events: auto;
}

.off-canvas__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.off-canvas__logo img {
  height: 72px;
  object-fit: contain;
}

.off-canvas__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
  transform: rotate(45deg);
  color: var(--color-text);
  padding: 0;
}

.off-canvas__nav {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-xl);
}

.off-canvas__nav a {
  display: block;
  padding: 12px;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-accent);
  color: var(--color-accent);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-base), color var(--transition-base);
}

.off-canvas__nav a:hover,
.off-canvas__nav a.active {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

.off-canvas__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: auto;
  padding-top: var(--space-lg);
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */

/* Laptop: 1025px - 1280px — full nav + top bar stay, just tighter spacing */
@media (max-width: 1280px) {
  .header {
    --edge: 20px;
  }

  .header__menu {
    gap: 4px;
  }

  .header__menu-item > a {
    padding-left: 5px;
    padding-right: 5px;
  }

  .header__logo img {
    height: var(--header-logo-height-laptop);
  }
}

/* Tablet & below: collapse to hamburger at 1024px */
@media (max-width: 1024px) {
  .header {
    padding: 15px 0;
  }

  .header::before {
    display: none;
  }

  .header__inner {
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 0;
  }

  .header__main {
    padding-top: 0;
  }

  .header__topbar {
    display: none;
  }

  .header__menu {
    display: none;
  }

  .header__hamburger {
    display: flex;
  }

  .header__login {
    display: none;
  }

  .header__actions .btn {
    display: none;
  }

  .header__logo img {
    height: 60px;
  }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  .header__logo img {
    height: 50px;
  }

  .header__hamburger img {
    width: 25px;
    height: 25px;
  }

  .off-canvas {
    max-width: 100%;
  }
}

/* Laptop + desktop full-nav range — hide mobile elements */
@media (min-width: 1025px) {
  .header__hamburger {
    display: none;
  }

  .off-canvas,
  .off-canvas__overlay {
    display: none !important;
  }
}
