/* Transparent, Fixed Header Default State */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.3s ease-in-out, background-color 0.35s ease, top 0.3s ease, border-color 0.35s ease;
}

body.has-announcement-ticker .site-header {
  top: 30px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.35s ease;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 28px;
  width: auto;
  display: block;
  transition: height 0.35s ease, filter 0.35s ease;
  filter: invert(1) brightness(2);
}

.nav-link {
  font-family: var(--font-cta);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  padding: 10px 0;
  position: relative;
  transition: color 0.35s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #ffffff;
  transition: width 0.3s ease;
}

.nav-item:hover > .nav-link::after,
.nav-item:focus-within > .nav-link::after {
  width: 100%;
}

.header-utils button, .header-utils a {
  font-size: 1.1rem;
  color: #ffffff;
  position: relative;
  padding: 5px;
  transition: color 0.35s ease;
}

.nav-toggle {
  display: none;
  font-size: 1.5rem;
  color: #ffffff;
  transition: color 0.35s ease;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: var(--accent-color);
  color: #fff;
  font-size: 0.6rem;
  font-family: var(--font-cta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 4px;
  pointer-events: none;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ── Scrolled State ── */
.site-header.scrolled {
  top: 0;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.site-header.scrolled .header-container {
  padding: 12px 15px;
}

.site-header.scrolled .logo-img {
  height: 23px;
  filter: none;
}

.site-header.scrolled .nav-link {
  color: var(--nav-text);
}

.site-header.scrolled .nav-link::after {
  background-color: var(--text-color);
}

.site-header.scrolled .header-utils button, .site-header.scrolled .header-utils a {
  color: var(--header-text);
}

.site-header.scrolled .nav-toggle {
  color: var(--header-text);
}


/* Navigation */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-item {
  position: relative;
}

.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 200px;
  width: max-content;
  transform: translateX(-50%) translateY(12px);
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 15px 18px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
  /* reset list defaults */
  list-style: none;
  margin: 0;
  display: block;
  flex-direction: unset;
  gap: unset;
}

.nav-menu .nav-item:hover > .sub-menu,
.nav-menu .nav-item:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-menu .sub-menu .nav-item {
  margin-bottom: 8px;
}

.nav-menu .sub-menu .nav-item:last-child {
  margin-bottom: 0;
}

.nav-menu .sub-menu .nav-link {
  color: var(--text-light);
  display: block;
  white-space: nowrap;
}

.nav-menu .sub-menu .nav-link::after {
  display: none;
}

.nav-menu .sub-menu .nav-link:hover {
  color: var(--text-color);
  padding-left: 5px;
}

/* Mega Menu */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  min-width: 600px;
  max-width: min(900px, 90vw);
  width: max-content;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
}

.nav-item:hover .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-col h4 {
  font-family: var(--font-cta);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-color);
  margin-bottom: 15px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-col ul li {
  margin-bottom: 8px;
}

.dropdown-col ul li a {
  font-size: 0.85rem;
  color: var(--text-light);
}

.dropdown-col ul li a:hover {
  color: var(--text-color);
  padding-left: 5px;
}

.dropdown-col-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-link-item a {
  font-size: 0.85rem;
  color: var(--text-light);
}

.mega-link-item a::after {
  display: none;
}

.mega-link-item a:hover {
  color: var(--text-color);
  padding-left: 5px;
}

.dropdown-image {
  grid-column: span 1;
  position: relative;
  overflow: hidden;
}

.dropdown-col .dropdown-image {
  display: block;
  min-height: 150px;
  margin-top: 8px;
}

.dropdown-col .dropdown-image:first-child {
  margin-top: 0;
}

.dropdown-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.dropdown-image:hover img {
  transform: scale(1.05);
}

.dropdown-image-label {
  position: absolute;
  bottom: 15px;
  left: 15px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Overlay Backdrop */
.overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

/* Responsive */
@media screen and (max-width: 1200px) {
  .mega-dropdown {
    max-width: 90vw;
  }
}

@media screen and (max-width: 992px) {
  .site-header {
    background-color: rgba(195, 181, 165, 0.98);
    border-bottom: 1px solid var(--nav-border);
    top: 30px !important;
  }

  .header-container {
    min-height: 62px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    justify-items: center;
    position: relative;
  }

  .site-header.scrolled {
    top: 0 !important;
  }

  .site-header.scrolled .header-container {
    padding: 12px 18px;
  }

  .logo-container {
    grid-column: 2;
    justify-self: center;
  }

  .logo-img {
    filter: none !important;
    height: 22px !important;
  }

  .header-utils button, .header-utils a, .nav-toggle {
    color: var(--header-text) !important;
  }

  .header-utils {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0;
  }

  .header-utils > a,
  .header-utils > button {
    display: none;
  }

  .header-utils #search-btn,
  .header-utils #cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 30px;
    padding: 0;
    font-size: 0.95rem;
  }

  /* Desktop nav is hidden on mobile — fullscreen overlay handles navigation */
  .nav-menu {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 1;
    justify-self: start;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 1.05rem;
  }

  .nav-item:hover .mega-dropdown {
    display: none;
  }
}
