.site-header {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  background: transparent;
  color: #fff;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
    box-shadow 0.35s var(--ease), top 0.35s var(--ease);
}

.site-header.is-sticky {
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(10px);
  color: var(--color-dark);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
}

.site-header__logo {
  display: flex;
  align-items: center;
  height: 36px;
}
.site-header__logo-light {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.3));
  transition: opacity 0.3s var(--ease);
}
.site-header__logo-dark {
  display: none;
  font-size: var(--fs-20);
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--color-dark);
}

.site-header.is-sticky .site-header__logo-light {
  display: none;
}
.site-header.is-sticky .site-header__logo-dark {
  display: inline-block;
}

.site-header__nav {
  display: flex;
  justify-content: center;
}
.site-header__nav ul {
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
}
.site-header__nav a {
  position: relative;
  font-size: var(--fs-14);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 0;
  transition: opacity 0.25s var(--ease);
}
.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.site-header__nav a:hover::after {
  transform: scaleX(1);
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.site-header.is-sticky .icon-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}
.icon-btn svg {
  width: 22px;
  height: 22px;
}
.icon-btn--cart img {
  width: 22px;
  height: 22px;
  display: block;
}

/* On dark hero (default header state), invert basket so it reads as white.
   Reverts to natural dark when header becomes sticky or uses black variant. */
.site-header:not(.is-sticky):not(.site-header--black) .icon-btn--cart img {
  filter: brightness(0) invert(1);
}

.icon-btn__badge {
  position: absolute;
  top: 20px;
  right: 0px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--color-lime, #dde58a);
  color: var(--color-dark);
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

/* Cart badge bump animation (fires when a product is added to cart) */
@keyframes cart-bump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.45); background: #e87a5d; }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.icon-btn--cart .icon-btn__badge.is-bumping {
  animation: cart-bump 0.55s var(--ease);
}

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.hamburger span {
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.hamburger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.hamburger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Drawer */
.site-header__drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(82vw, 360px);
  height: 100vh;
  background: #fff;
  color: var(--color-dark);
  padding: calc(var(--header-h) + 24px) var(--sp-32) var(--sp-32);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  box-shadow: var(--shadow-lg);
  z-index: 49;
}
.site-header__drawer.is-open {
  transform: translateX(0);
}
.site-header__drawer ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-24);
}
.site-header__drawer a {
  font-size: var(--fs-20);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Close (X) button inside the drawer */
.site-header__drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  color: currentColor;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.25s var(--ease), transform 0.3s var(--ease);
}
.site-header__drawer-close:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: rotate(90deg);
}
.site-header__drawer-close svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 899px) {
  .site-header__nav {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

@media (max-width: 639px) {
  .site-header {
    top: 36px;
  }
  .icon-btn svg {
    width: 20px;
    height: 20px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  /* hide secondary tools on tiny screens */
  .site-header__tools .icon-btn:not(.icon-btn--cart) {
    display: none;
  }
}
