/* ───── KARAFT header (Prestige Allure clone) ─────
   White surface, 3-column grid (nav · centered logo · actions), hairline
   bottom border, soft shadow on scroll. Mobile collapses to burger + drawer. */

.kf-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.kf-header.is-stuck { box-shadow: 0 1px 18px rgba(0, 0, 0, 0.06); }

/* Home: announcement + header float transparently over the hero, then the
   header turns into a solid sticky bar once the page scrolls. Hero text/icons
   are dark because the Prestige hero image is light. */
.kf-home .kf-announce {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 61;
  background: transparent;
  border-bottom-color: transparent;
}
.kf-home .kf-header {
  position: absolute;
  top: 38px; left: 0; right: 0;
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}
.kf-home .kf-header.is-stuck {
  position: fixed;
  top: 0;
  background: var(--color-surface);
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 18px rgba(0, 0, 0, 0.06);
}
/* Transparent home header fills to a solid white bar on hover. */
.kf-home .kf-header:hover {
  background: var(--color-surface);
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 18px rgba(0, 0, 0, 0.06);
}
@media (max-width: 900px) {
  .kf-home .kf-header { top: 34px; }
}

.kf-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
  gap: 24px;
}

/* Logo — capped to fit the fixed 72px header. max-height wins over the
   merchant's logo_width so a tall/square logo can never grow the header. */
.kf-header__logo {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
}
.kf-header__logo img {
  display: block;
  width: auto;
  height: auto;
  max-height: 32px;
  object-fit: contain;
}
.kf-header__wordmark {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-indent: 0.28em;
  color: var(--color-text);
  max-width: 60vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav (left) */
.kf-header__nav--left {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 30px;
}
.kf-header__nav-group { position: relative; }
.kf-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  color: var(--color-text);
  padding-block: 8px;
  position: relative;
}
.kf-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.kf-header__nav-link:hover::after { transform: scaleX(1); }

/* Dropdown */
.kf-header__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
  z-index: 5;
}
.kf-header__nav-group:hover .kf-header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.kf-header__dropdown-link {
  display: block;
  padding: 9px 20px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}
.kf-header__dropdown-link:hover { color: var(--color-text); }

/* ───── Mega menu (Prestige full-width panel) ─────
   The group goes position:static so the panel positions against the sticky
   header (full viewport width) instead of the narrow nav-group box. */
.kf-header__nav-group--mega { position: static; }
.kf-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 55;
}
.kf-header__nav-group--mega:hover .kf-mega,
.kf-header__nav-group--mega:focus-within .kf-mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.kf-mega__inner {
  display: flex;
  gap: 56px;
  align-items: flex-start;
  padding-top: 44px;
  padding-bottom: 44px;
}
.kf-mega__cols {
  flex: 1;
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}
.kf-mega__cols--flat { display: block; }
.kf-mega__col { min-width: 150px; }
.kf-mega__col-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 16px;
}
.kf-mega__list { list-style: none; margin: 0; padding: 0; }
.kf-mega__list--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 4px 56px;
}
.kf-mega__list li { margin: 0; }
.kf-mega__link {
  display: inline-block;
  padding: 7px 0;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}
.kf-mega__link:hover { color: var(--color-text); }

/* Featured promo cards (right) */
.kf-mega__promos {
  display: flex;
  gap: 20px;
  flex: none;
}
.kf-mega__promo { display: block; width: 200px; }
.kf-mega__promo-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-bg);
  margin-bottom: 12px;
}
.kf-mega__promo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.kf-mega__promo:hover .kf-mega__promo-img { transform: scale(1.04); }
.kf-mega__promo-eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.kf-mega__promo-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--color-text);
  margin-top: 2px;
}

/* Actions (right) */
.kf-header__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}
.kf-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--color-text);
  background: none;
  border: 0;
  padding: 0;
  transition: opacity 0.2s ease;
}
.kf-header__icon:hover { opacity: 0.6; }
.kf-header__icon .icon { width: 21px; height: 21px; }
.kf-header__cart-count {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-text);
  color: var(--color-surface);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Burger — hidden on desktop */
.kf-header__burger {
  grid-column: 1;
  justify-self: start;
  display: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--color-text);
}
.kf-header__burger .icon { width: 24px; height: 24px; }

/* ───── Mobile nav drawer ───── */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  pointer-events: none;
}
.nav-drawer.nav-drawer--open { visibility: visible; pointer-events: auto; }
.nav-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-drawer.nav-drawer--open .nav-drawer__overlay { opacity: 1; }
.nav-drawer__panel {
  position: absolute;
  top: 0; left: 0;
  width: min(82vw, 360px);
  height: 100%;
  background: var(--color-surface);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.nav-drawer.nav-drawer--open .nav-drawer__panel { transform: none; }
.nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--color-border);
}
.nav-drawer__head .kf-header__wordmark { font-size: 18px; }
.nav-drawer__head button { background: none; border: 0; color: var(--color-text); }
.nav-drawer__head .icon { width: 22px; height: 22px; }
.nav-drawer__links { padding: 14px 0; }
.nav-drawer__link {
  display: block;
  padding: 14px 24px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: var(--track-nav);
  text-transform: uppercase;
  color: var(--color-text);
}
.nav-drawer__link--child {
  padding-left: 40px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

/* ───── Responsive ───── */
@media (max-width: 900px) {
  .kf-header__nav--left { display: none; }
  .kf-header__burger { display: inline-flex; }
  .kf-header__inner { height: 60px; grid-template-columns: 1fr auto 1fr; }
  .kf-header__logo img { max-height: 30px; }
  .kf-header__wordmark { font-size: 19px; letter-spacing: 0.22em; }
  .kf-header__icon--hide-mobile { display: none; }
  .kf-header__actions { gap: 16px; }
}

/* Mobile: larger, tappable header icons (were 21px, too small next to the wordmark) */
@media (max-width: 900px) {
  .kf-header__actions { gap: 6px; }
  .kf-header__icon { width: 44px; height: 44px; }
  .kf-header__icon .icon { width: 24px; height: 24px; }
  .kf-header__wordmark { font-size: 19px; letter-spacing: 0.18em; }
}
