/* ==========================================================================
   RIVAL Shoes - Navigation
   ========================================================================== */

/* ---- Header ---- */

.header {
  position: fixed;
  top: var(--ticker-offset, 0px);
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  transition:
    background var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.header--transparent {
  background: transparent;
}

.header--solid {
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.header--hidden {
  transform: translateY(calc(-1 * (var(--header-height) + var(--ticker-offset, 0px))));
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-md);
}

/* ---- Logo ---- */

.header__logo {
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}

.header__logo img {
  height: 70px;
  width: auto;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.header__logo:hover img {
  opacity: 0.8;
}


/* ---- Desktop Navigation ---- */

.desktop-nav {
  display: none;
}

@media (min-width: 769px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }
}

.desktop-nav__link {
  font-family: var(--font-primary);
  font-weight: var(--fw-regular);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--duration-fast) var(--ease-out);
}

/* Underline hover effect */
.desktop-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  transition: width var(--duration-normal) var(--ease-out);
}

.desktop-nav__link:hover::after {
  width: 100%;
}

/* Colors: transparent header = white links */
.header--transparent .desktop-nav__link {
  color: var(--color-white);
}

.header--transparent .desktop-nav__link::after {
  background: var(--color-accent);
}

.header--transparent .desktop-nav__link:hover {
  color: var(--color-accent);
}

/* Colors: solid header = dark links */
.header--solid .desktop-nav__link {
  color: var(--color-gray-500);
}

.header--solid .desktop-nav__link::after {
  background: var(--color-accent);
}

.header--solid .desktop-nav__link:hover {
  color: var(--color-black);
}

/* ---- Desktop Dropdown ---- */

.desktop-nav__dropdown {
  position: relative;
}

.desktop-nav__link--parent::after {
  display: none;
}

.desktop-nav__submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  padding: 0.75rem 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    visibility var(--duration-fast) var(--ease-out);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  border-radius: 2px;
  margin-top: 0.5rem;
}

.desktop-nav__dropdown:hover .desktop-nav__submenu {
  opacity: 1;
  visibility: visible;
}

.desktop-nav__submenu a {
  display: block;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: var(--fw-regular);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-gray-500);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.desktop-nav__submenu a:hover {
  color: var(--color-black);
  background: var(--color-off-white);
}

/* ---- Header Actions ---- */

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

/* ---- Language Select ---- */

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: inherit;
  font-family: var(--font-primary);
  font-size: 0.8rem;
  font-weight: var(--fw-regular);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 2rem 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fff' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px;
}

.header--transparent .lang-select {
  color: var(--color-white);
  border-color: rgba(255,255,255,0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fff' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
}

.header--solid .lang-select {
  color: var(--color-gray-500);
  border-color: var(--color-gray-200);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
}

.lang-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.lang-select option {
  color: var(--color-gray-500);
  background: var(--color-white);
}

/* ---- Hamburger Menu Button ---- */

.hamburger {
  display: none;
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  padding: 0;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-black);
  transition: all var(--duration-normal) var(--ease-out);
  position: absolute;
  left: 0;
}

.hamburger__line:nth-child(1) {
  top: 0;
}

.hamburger__line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger__line:nth-child(3) {
  bottom: 0;
}

/* Hamburger Active State (X shape) */
.hamburger.active .hamburger__line:nth-child(1) {
  transform: rotate(45deg);
  top: 50%;
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: rotate(-45deg);
  bottom: auto;
  top: 50%;
}

/* Hamburger Colors Based on Header State */
.header--transparent .hamburger__line {
  background: var(--color-white);
}

.header--solid .hamburger__line {
  background: var(--color-black);
}

/* When nav is open, lines are always white */
.hamburger.active .hamburger__line {
  background: var(--color-white);
}

/* ---- Full-Screen Navigation Overlay (mobile only) ---- */

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-slow) var(--ease-in-out);
}

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

.nav-overlay__menu {
  list-style: none;
  text-align: center;
  padding: 0;
}

.nav-overlay__item {
  overflow: hidden;
}

.nav-overlay__link {
  display: block;
  color: var(--color-white);
  font-family: var(--font-primary);
  font-weight: var(--fw-light);
  font-size: clamp(1.5rem, 4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  padding: 0.75rem 0;
  transition:
    color var(--duration-fast) var(--ease-out),
    opacity var(--duration-normal) var(--ease-out);
}

.nav-overlay__link:hover {
  color: var(--color-accent);
}

/* ---- Submenu ---- */

.nav-overlay__submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}

.nav-overlay__submenu.open {
  max-height: 300px;
}

.nav-overlay__submenu a {
  display: block;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: var(--fw-light);
  letter-spacing: 0.15em;
  color: var(--color-gray-300);
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-overlay__submenu a:hover {
  color: var(--color-accent);
}

/* ---- Decorative Element ---- */

.nav-overlay__decoration {
  position: absolute;
  bottom: 5%;
  right: 5%;
  opacity: 0.03;
  width: 300px;
  pointer-events: none;
}

.nav-overlay__decoration img {
  width: 100%;
  height: auto;
}

/* ---- Mobile Adjustments ---- */

@media (max-width: 768px) {
  .header__inner {
    padding: 0 var(--space-sm);
  }

  .header__logo img {
    height: 32px;
  }

  .nav-overlay__link {
    padding: 0.5rem 0;
  }

  .lang-select {
    font-size: 0.7rem;
    padding: 0.3rem 1.6rem 0.3rem 0.6rem;
  }
}
