/**
 * FitnessGuru — header (matches html/inner.html)
 * Upload: bootstrap/front/css/header.css
 */

.site-header {
  --fg-red: #e31e24;
  --fg-red-dark: #c41a1f;
  --fg-black: #000000;
  --fg-border: #dddddd;
  --fg-font-display: "Oswald", "Arial Narrow", sans-serif;
  --fg-font-body: "Open Sans", Arial, sans-serif;
  --fg-header-x: 15px;

  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--fg-black);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.site-header .header-bar {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px var(--fg-header-x);
  border-bottom: 3px solid var(--fg-red);
  transition: padding 0.35s ease;
  box-sizing: border-box;
}

.site-header.is-scrolled .header-bar {
  padding-top: 7px;
  padding-bottom: 7px;
}

.site-header .nav-overlay {
  display: none;
}

.site-header .brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  align-self: center;
  text-decoration: none;
}

.site-header .brand-logo {
  display: block;
  height: 58px;
  width: auto;
  max-width: min(240px, 48vw);
  object-fit: contain;
  object-position: left center;
  transition: height 0.35s ease, max-width 0.35s ease;
}

.site-header.is-scrolled .brand-logo {
  height: 42px;
  max-width: min(200px, 42vw);
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.site-header .main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.site-header .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.site-header .nav-list > li {
  position: relative;
  display: flex;
  align-items: center;
}

.site-header .nav-list > li + li::before {
  content: "";
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  margin: 0 0.05rem;
}

.site-header .nav-list > li > a,
.site-header .nav-list > li > .nav-parent {
  position: relative;
  display: block;
  padding: 9px 15px;
  font-family: var(--fg-font-body) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.9) !important;
  white-space: nowrap;
  transition: color 0.2s ease;
  text-decoration: none !important;
  background: none;
  border: none;
  box-shadow: none;
}

.site-header .nav-list > li > a::after,
.site-header .nav-list > li > .nav-parent::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 6px;
  height: 2px;
  background: var(--fg-red);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.site-header .nav-list > li > a:hover,
.site-header .nav-list > li > .nav-parent:hover,
.site-header .nav-item-has-sub:hover > .nav-parent,
.site-header .nav-item-has-sub:focus-within > .nav-parent {
  color: #fff !important;
}

.site-header .nav-list > li > a:hover::after,
.site-header .nav-list > li > .nav-parent:hover::after,
.site-header .nav-item-has-sub:hover > .nav-parent::after,
.site-header .nav-item-has-sub:focus-within > .nav-parent::after {
  transform: scaleX(1);
}

.site-header .nav-list > li > a.is-active {
  color: #fff !important;
  outline: 1px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.site-header .nav-list > li > a.is-active::after {
  display: none;
}

.site-header .nav-item-has-sub {
  position: relative;
}

.site-header .nav-parent {
  cursor: pointer;
  padding-right: 22px !important;
}

.site-header .nav-parent .nav-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -2px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.65;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.site-header .nav-item-has-sub:hover .nav-caret,
.site-header .nav-item-has-sub.is-open .nav-caret {
  transform: rotate(180deg);
}

.site-header .nav-sub {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--fg-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.site-header .nav-sub a {
  display: block;
  padding: 9px 18px;
  font-family: var(--fg-font-body) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #333 !important;
  text-transform: none;
  letter-spacing: 0.01em;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none !important;
}

.site-header .nav-sub a:hover {
  background: #f8f8f8;
  color: var(--fg-red) !important;
  border-left-color: var(--fg-red);
}

@media (min-width: 901px) {
  .site-header .nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 60;
  }

  .site-header .nav-item-has-sub:hover .nav-sub,
  .site-header .nav-item-has-sub:focus-within .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.site-header .header-shop {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 22px;
  background: var(--fg-red);
  color: #fff !important;
  font-family: var(--fg-font-body) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  white-space: nowrap;
  transition: background 0.2s ease;
  text-decoration: none !important;
}

.site-header .header-shop:hover {
  background: var(--fg-red-dark);
  color: #fff !important;
}

.site-header .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.site-header .nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-header .nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header .nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.site-header .nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Less top spacer — old navbar used ~89px */
body.has-fg-header .top_exm {
  padding-top: 20px !important;
}

@media (max-width: 1100px) {
  .site-header .nav-list > li > a,
  .site-header .nav-list > li > .nav-parent {
    padding: 8px 10px;
    font-size: 11px !important;
    letter-spacing: 0.1em;
  }

  .site-header .nav-list > li > a::after,
  .site-header .nav-list > li > .nav-parent::after {
    left: 10px;
    right: 10px;
  }
}

@media (max-width: 900px) {
  .site-header .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    z-index: 298;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  .site-header .nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .site-header .nav-toggle {
    display: flex;
  }

  .site-header .header-actions {
    gap: 0.5rem;
  }

  .site-header .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100vh;
    height: 100dvh;
    flex: none;
    justify-content: flex-start;
    background: var(--fg-black);
    border-left: 3px solid var(--fg-red);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 299;
    overflow-y: auto;
  }

  .site-header .main-nav.is-open {
    transform: translateX(0);
  }

  .site-header .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 4.5rem 0 1.5rem;
    gap: 0;
    width: 100%;
  }

  .site-header .nav-list > li {
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .site-header .nav-list > li + li::before {
    display: none;
  }

  .site-header .nav-list > li > a,
  .site-header .nav-list > li > .nav-parent {
    padding: 16px 20px;
    font-size: 13px !important;
    letter-spacing: 0.12em;
  }

  .site-header .nav-list > li > a::after,
  .site-header .nav-list > li > .nav-parent::after {
    display: none;
  }

  .site-header .nav-list > li > a.is-active {
    outline: none;
    background: rgba(227, 30, 36, 0.15);
    border-left: 3px solid var(--fg-red);
  }

  .site-header .nav-sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0;
    min-width: 0;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
    display: none;
  }

  .site-header .nav-item-has-sub.is-open .nav-sub {
    display: block;
  }

  .site-header .nav-sub a {
    padding: 12px 20px 12px 28px;
    color: rgba(255, 255, 255, 0.85) !important;
    border-left: none;
  }

  .site-header .nav-sub a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff !important;
  }

  .site-header .nav-item-has-sub .nav-parent {
    width: 100%;
    text-align: left;
  }

  .site-header .header-shop {
    padding: 0 14px;
    min-height: 36px;
    font-size: 10px !important;
  }
}

@media (max-width: 480px) {
  .site-header .brand-logo {
    height: 48px;
    max-width: 180px;
  }

  .site-header.is-scrolled .brand-logo {
    height: 36px;
    max-width: 150px;
  }

  .site-header .header-bar {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
