/* ==========================================================================
   Header Component
   ========================================================================== */

sticky-header {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

.header {
  position: relative;
  width: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 70%, transparent 100%);
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Add subtle shadow for depth */
.header::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.header--scrolled {
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header--scrolled::before {
  opacity: 1;
}

.header__wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

@media screen and (min-width: 990px) {
  .header__wrapper {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

/* Header Left */
.header__left {
  justify-self: start;
}

@media screen and (min-width: 990px) {
  .header__left {
    visibility: hidden;
  }
}

.header__icon--menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;  /* 44px — WCAG 2.5.5 minimum touch target */
  height: 4.4rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header__icon--menu:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
  color: var(--color-cyan);
  box-shadow: 0 0 20px rgba(0, 216, 214, 0.4),
              0 4px 8px rgba(0, 0, 0, 0.3);
}

.header__icon--menu:active {
  transform: scale(0.95);
}

@media screen and (min-width: 990px) {
  .header__icon--menu {
    display: none;
  }
}

/* Header Center */
.header__center {
  justify-self: center;
}

.header__logo {
  display: block;
  max-width: 80px;
  line-height: 0;
  font-size: 0;
  color: transparent;
}

@media screen and (min-width: 750px) {
  .header__logo {
    max-width: 110px;
  }
}

@media screen and (min-width: 990px) {
  .header__logo {
    max-width: 140px;
  }
}

.header__logo img {
  display: block !important;
  width: 100%;
  height: auto;
  object-fit: contain;
  max-width: 100%;
}

.header__logo-text {
  font-size: 2.4rem;
  font-weight: 700;
  font-family: var(--font-heading-family);
  text-decoration: none;
  color: var(--color-text);
}

/* Header Right */
.header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

/* Header Navigation */
.header__nav {
  display: none;
  flex-shrink: 0;
}

@media screen and (min-width: 990px) {
  .header__nav {
    display: block;
  }
}

.header__menu {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header__menu-item {
  white-space: nowrap;
}

.header__menu-link {
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  position: relative;
  font-family: 'Inter', var(--font-body-family);
  letter-spacing: 0.03em;
}

.header__menu-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-cyan);
  transition: width 0.3s ease;
}

.header__menu-link:hover {
  color: var(--color-cyan);
  text-shadow: 0 0 8px rgba(0, 216, 214, 0.6),
               0 2px 4px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.header__menu-link:hover::after,
.header__menu-link.active::after {
  width: 100%;
}

.header__menu-link.active {
  color: var(--color-cyan);
  text-shadow: 0 0 8px rgba(0, 216, 214, 0.6),
               0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Header Icons */
.header__icons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;  /* 44px — WCAG 2.5.5 minimum touch target */
  height: 4.4rem;
  color: #ffffff;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.header__icon:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.1);
  color: var(--color-cyan);
  box-shadow: 0 0 20px rgba(0, 216, 214, 0.4),
              0 4px 8px rgba(0, 0, 0, 0.3);
}

.header__icon:active {
  transform: translateY(0) scale(0.95);
}

.header__icon svg {
  width: 1.8rem;
  height: 1.8rem;
  transition: transform 0.3s ease;
}

.header__icon:hover svg {
  transform: rotate(5deg);
}

.header__cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.8rem;
  padding: 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: #ffffff;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
              0 0 12px rgba(0, 216, 214, 0.6);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: pulse 2s ease-in-out infinite;
}

.header__icon--cart:hover .header__cart-count {
  transform: scale(1.2);
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Mobile Menu — full-screen backdrop + slide-in panel */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s ease;
  pointer-events: none;
  cursor: pointer; /* clicking backdrop closes menu */
}

.mobile-menu.active {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.3s ease;
  pointer-events: auto;
}

.mobile-menu__content {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.6) 100%),
    url('/images/cards/Mountain_8a2282cb-f5a6-4b0f-8cdd-3cd9f6a1b151.webp') center/cover no-repeat;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  cursor: default;
}

.mobile-menu.active .mobile-menu__content {
  transform: translateX(0);
}

.mobile-menu__header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2rem;
  border-bottom: 2px solid rgba(0, 216, 214, 0.2);
  background: linear-gradient(to right, rgba(0, 216, 214, 0.1), transparent);
}

.mobile-menu__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  padding: 0;
  background: rgba(0, 216, 214, 0.1);
  border: 2px solid var(--color-cyan);
  border-radius: 50%;
  color: var(--color-cyan);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu__close:hover {
  background: var(--color-cyan);
  color: #ffffff;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px rgba(0, 216, 214, 0.6);
}

.mobile-menu__close:active {
  transform: rotate(90deg) scale(0.95);
}

.mobile-menu__nav {
  padding: 2rem 1.5rem;
}

.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu__item {
  margin-bottom: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.mobile-menu__link {
  display: block;
  padding: 1.2rem 1.5rem;
  padding-left: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-left: 4px solid transparent;
  font-family: 'Inter', var(--font-body-family);
  letter-spacing: 0.05em;
  color: #ffffff;
  position: relative;
}

.mobile-menu__link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--color-cyan);
  transition: height 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu__link:hover {
  padding-left: 2rem;
  color: var(--color-cyan);
  background: linear-gradient(90deg, rgba(0, 216, 214, 0.2), transparent);
  text-shadow: 0 0 10px rgba(0, 216, 214, 0.4);
  transform: translateX(5px);
}

.mobile-menu__link:hover::before {
  height: 100%;
}

.mobile-menu__link.active {
  padding-left: 2rem;
  color: var(--color-cyan);
  background: linear-gradient(90deg, rgba(0, 216, 214, 0.2), transparent);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 216, 214, 0.4);
}

.mobile-menu__link.active::before {
  height: 100%;
  background: var(--color-cyan);
}

/* Custom scrollbar for mobile menu */
.mobile-menu__content::-webkit-scrollbar {
  width: 6px;
}

.mobile-menu__content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.mobile-menu__content::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--color-cyan), var(--color-purple));
  border-radius: 3px;
}

.mobile-menu__content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--color-cyan), var(--color-blue));
}

@media screen and (min-width: 990px) {
  .mobile-menu {
    display: none;
  }
}
