/* Header styles for ZoneXxia Auto Conseil */

.xx-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: radial-gradient(circle at top left, rgba(46, 143, 255, 0.22), transparent 55%),
              linear-gradient(to bottom, rgba(7, 11, 16, 0.94), rgba(7, 11, 16, 0.88));
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.xx-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  gap: var(--space-4);
}

/* Brand */
.xx-header__brand {
  display: flex;
  align-items: center;
}

.xx-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
}

.xx-header__logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.22), transparent 55%),
    conic-gradient(from 210deg, #4ba2ff, #2e8fff, #7aa9ff, #2e8fff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.7);
}

.xx-header__logo-glyph {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f9fbff;
}

.xx-header__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.xx-header__brand-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.xx-header__brand-tagline {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Navigation */
.xx-header__nav {
  display: flex;
}

.xx-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.xx-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 0.35rem 0;
}

.xx-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ba2ff, #2e8fff);
  transition: width var(--transition-base);
}

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

.xx-header__nav-link:hover::after,
.xx-header__nav-link:focus-visible::after {
  width: 100%;
}

.xx-header__nav-item--cta .xx-header__nav-link--cta {
  padding-inline: 1.1rem;
  font-size: 0.78rem;
}

/* Mobile toggle */
.xx-header__toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 55%),
              rgba(10, 14, 22, 0.95);
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.xx-header__toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background-color: var(--color-text);
  transition: transform var(--transition-base), opacity var(--transition-base),
              background-color var(--transition-base);
}

.xx-header__toggle-bar + .xx-header__toggle-bar {
  margin-top: 4px;
}

.xx-header__toggle:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Toggle active state (controlled via JS) */
.xx-header__toggle--active .xx-header__toggle-bar:nth-child(1) {
  transform: translateY(13px) rotate(45deg);
}

.xx-header__toggle--active .xx-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.xx-header__toggle--active .xx-header__toggle-bar:nth-child(3) {
  transform: translateY(-13px) rotate(-45deg);
}

/* Mobile layout */
@media (max-width: 768px) {
  .xx-header__inner {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .xx-header__toggle {
    display: inline-flex;
    flex-direction: column;
  }

  .xx-header__nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    transform-origin: top center;
    transform: scaleY(0.96);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
  }

  .xx-header__nav-list {
    flex-direction: column;
    align-items: stretch;
    margin-top: var(--space-2);
    margin-bottom: var(--space-3);
    margin-inline: var(--space-4);
    padding: var(--space-3);
    border-radius: var(--radius-xl);
    background:
      radial-gradient(circle at top left, rgba(46, 143, 255, 0.2), transparent 65%),
      linear-gradient(145deg, #050911, #0b111c);
    box-shadow: var(--shadow-soft-border);
  }

  .xx-header__nav-link {
    padding-block: 0.6rem;
  }

  .xx-header__nav-item--cta {
    margin-top: var(--space-2);
  }

  .xx-header__nav--open {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
  }
}

/* Medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
  .xx-header__nav-list {
    gap: var(--space-3);
  }
}

/* High-contrast states for keyboard users */
.xx-header__nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 143, 255, 0.8);
  border-radius: 999px;
  padding-inline: 0.75rem;
}
