/* ================================================
   TSV HEADER
   ================================================ */

/* Override Catch Everest header */
#masthead,
.site-header {
    background: var(--tsv-dark) !important;
    border-bottom: 3px solid var(--tsv-primary) !important;
    box-shadow: none !important;
    padding: 0 !important;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.tsv-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--tsv-max-width);
    margin: 0 auto;
    padding: 0 48px;
    height: 64px;
    gap: 16px;
}

/* Logo */
.tsv-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.tsv-logo img {
    height: 44px;
    width: auto;
    display: block;
}
.tsv-logo__text {
    display: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--tsv-white);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
}
.tsv-logo__text span { color: var(--tsv-primary); }

/* Primary nav */
.tsv-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}
.tsv-nav__list > li {
    position: relative;
}
.tsv-nav__list > li > a {
    display: block;
    padding: 0 14px;
    height: 64px;
    line-height: 64px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.tsv-nav__list > li > a:hover,
.tsv-nav__list > li.current-menu-item > a,
.tsv-nav__list > li.current-menu-ancestor > a {
    color: var(--tsv-white);
    background: rgba(204,0,0,0.15);
    text-decoration: none;
}

/* Dropdown */
.tsv-nav__list li ul {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    min-width: 200px;
    background: var(--tsv-dark);
    border-top: 2px solid var(--tsv-primary);
    border-radius: 0 0 var(--tsv-radius) var(--tsv-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 4px 0;
    list-style: none;
    margin: 0;
}
.tsv-nav__list li:hover > ul { display: block; }
.tsv-nav__list li ul li a {
    display: block;
    padding: 9px 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.tsv-nav__list li ul li a:hover {
    color: var(--tsv-white);
    background: rgba(204,0,0,0.2);
    text-decoration: none;
}
/* 3rd level */
.tsv-nav__list li ul li ul {
    top: 0;
    left: 100%;
    border-top: none;
    border-left: 2px solid var(--tsv-primary);
}

/* ── Top utility bar ── */
.tsv-topbar {
    background: #111111;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    height: 36px;
    display: flex;
    align-items: center;
}
.tsv-topbar__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}
.tsv-topbar__left {
    display: flex;
    gap: 20px;
    align-items: center;
}
.tsv-topbar__left a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s;
}
.tsv-topbar__left a:hover { color: rgba(255,255,255,0.9); }
.tsv-topbar__right {
    display: flex;
    gap: 14px;
    align-items: center;
}
.tsv-topbar__right a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
}
.tsv-topbar__right a:hover { color: rgba(255,255,255,0.9); }

/* ── Register button + hamburger group ── */
.tsv-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.tsv-nav-register {
    display: inline-block;
    background: var(--tsv-primary);
    color: #fff !important;
    padding: 9px 22px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    height: auto !important;
    line-height: 1 !important;
    transition: background 0.15s !important;
    border: none !important;
    text-decoration: none !important;
}
.tsv-nav-register:hover {
    background: #aa0000 !important;
    text-decoration: none !important;
    color: #fff !important;
}

/* Social icons in header */
.tsv-header-social {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: 16px;
}
.tsv-header-social a {
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    text-decoration: none;
    transition: color 0.15s;
}
.tsv-header-social a:hover { color: var(--tsv-white); }

/* Hamburger — mobile only */
.tsv-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
}
.tsv-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--tsv-white);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* Mobile nav */
@media (max-width: 900px) {

  /* Hamburger button */
  .tsv-hamburger { display: flex; }

  /* Nav panel — full width dropdown */
  .tsv-nav {
    display: none;
    position: fixed;
    top: 100px; /* header height + topbar */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tsv-dark);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 2px solid var(--tsv-primary);
    padding-bottom: 32px;
  }
  .tsv-nav.is-open { display: block; }

  /* Top-level list */
  .tsv-nav__list {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  /* Every top-level item */
  .tsv-nav__list > li {
    position: static;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .tsv-nav__list > li:last-child { border-bottom: none; }

  /* Top-level link wrapper — flex row */
  .tsv-nav__list > li > .tsv-nav-item-wrap {
    display: flex;
    align-items: stretch;
  }

  /* The actual page link */
  .tsv-nav__list > li > .tsv-nav-item-wrap > a {
    flex: 1;
    display: block;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    height: auto;
    line-height: 1.3;
    transition: color 0.15s, background 0.15s;
  }
  .tsv-nav__list > li > .tsv-nav-item-wrap > a:hover,
  .tsv-nav__list > li.current-menu-item > .tsv-nav-item-wrap > a,
  .tsv-nav__list > li.current-menu-ancestor > .tsv-nav-item-wrap > a {
    color: #fff;
    background: rgba(204,0,0,0.15);
  }

  /* Arrow toggle button — SEPARATE from the link */
  .tsv-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    background: none;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    color: rgba(255,255,255,0.50);
    font-size: 12px;
    transition: background 0.15s, color 0.15s;
    padding: 0;
  }
  .tsv-submenu-toggle:hover {
    background: rgba(204,0,0,0.15);
    color: #fff;
  }
  .tsv-submenu-toggle .tsv-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
    line-height: 1;
  }
  .tsv-submenu-toggle[aria-expanded="true"] .tsv-arrow {
    transform: rotate(90deg);
  }

  /* Hide toggle if no submenu */
  li:not(.menu-item-has-children) .tsv-submenu-toggle {
    display: none;
  }

  /* Submenu — hidden by default */
  .tsv-nav__list li ul {
    display: none;
    position: static;
    background: rgba(0,0,0,0.25);
    border-top: none;
    border-left: 3px solid var(--tsv-primary);
    border-radius: 0;
    box-shadow: none;
    margin-left: 20px;
    padding: 4px 0;
    list-style: none;
  }
  .tsv-nav__list li ul.is-open { display: block; }

  /* Submenu items */
  .tsv-nav__list li ul li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .tsv-nav__list li ul li:last-child { border-bottom: none; }

  .tsv-nav__list li ul li a {
    display: block;
    padding: 12px 16px 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
  }
  .tsv-nav__list li ul li a:hover {
    color: #fff;
    background: rgba(204,0,0,0.12);
  }
  .tsv-nav__list li ul li.current-menu-item a {
    color: var(--tsv-primary);
    font-weight: 700;
  }

  /* 3rd level submenu */
  .tsv-nav__list li ul li ul {
    margin-left: 16px;
    border-left: 2px solid rgba(204,0,0,0.40);
  }

  /* Register button in mobile menu */
  .tsv-nav-register { display: none; }

  /* Keep header inner padding on mobile */
  .tsv-header-inner { padding: 0 20px; height: 64px; }
}
