/* ==========================================================================
   TITAN GYM - HEADER & NAVIGATION STYLES (header.css)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(10, 12, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: var(--z-header);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

/* Brand Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-badge {
  background: var(--color-accent);
  color: var(--text-inverse);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-xs);
  transform: skewX(-10deg);
  display: inline-block;
  margin-right: 2px;
}

.logo-accent {
  color: var(--color-accent);
}

/* Horizontal Navigation Container */
.nav-container {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-grow: 1;
  justify-content: center;
  overflow: hidden; /* Key for JS scrollWidth vs clientWidth calculation */
  padding: 0 var(--space-sm);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  white-space: nowrap;
}

.nav-link {
  position: relative;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--color-accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0.6rem;
  right: 0.6rem;
  height: 2px;
  background-color: var(--color-accent);
  box-shadow: var(--shadow-glow);
  border-radius: var(--radius-full);
}

/* Header Actions / Right Side CTA */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

/* Hamburger Toggle Button */
.hamburger-toggle {
  display: none; /* Controlled by JS overflow check or fallback */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.hamburger-toggle:hover,
.hamburger-toggle:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.hamburger-toggle img,
.hamburger-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Mobile Drawer Menu (Activates when hamburguer is engaged) */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  transition: transform var(--transition-smooth);
  box-shadow: var(--shadow-lg);
}

.mobile-drawer.is-open {
  transform: translateX(-320px);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-lg);
}

.drawer-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.drawer-close-btn:hover {
  color: var(--color-accent);
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.drawer-nav-link {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-secondary);
  padding: 0.5rem var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.drawer-nav-link:hover,
.drawer-nav-link.active {
  color: var(--color-accent);
  background: var(--color-accent-dim);
}

.drawer-footer {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

/* Semi-transparent Overlay Backdrop */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Class toggled by JS when navigation overflows header */
.site-header.is-hamburger-mode .nav-container {
  display: none;
}

.site-header.is-hamburger-mode .hamburger-toggle {
  display: flex;
}
