/* ============================================================================
   Header, navigation, cart drawer, footer
   ========================================================================== */

/* --- announcement bar ---------------------------------------------------- */
.k4l-announce {
  background: var(--k4l-purple-mid);
  color: var(--k4l-white);
  font-weight: 700;
  font-size: var(--k4l-fs-md);
  text-align: center;
  padding: 10px 0;
}

/* --- header -------------------------------------------------------------- */
.k4l-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--k4l-white);
  border-bottom: 1px solid var(--k4l-border);
}

.k4l-header__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: var(--k4l-header-h);
}

.k4l-logo img { width: clamp(180px, 20vw, 290px); height: auto; }

/* --- nav ----------------------------------------------------------------- */
.k4l-nav { margin-right: auto; }

.k4l-nav__list {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.k4l-nav__item { position: relative; }

.k4l-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--k4l-font-body);
  font-size: var(--k4l-fs-md);
  font-weight: 500;
  line-height: 1;
  color: var(--k4l-ink);
  background: none;
  border: 0;
  padding: 12px 0;
  cursor: pointer;
  white-space: nowrap;
}
.k4l-nav__link:hover { color: var(--k4l-purple-mid); }

.k4l-caret { transition: transform .2s ease; flex: none; }
.k4l-nav__link[aria-expanded="true"] .k4l-caret { transform: rotate(180deg); }

/* --- dropdown panels ----------------------------------------------------- */
/* Measured at source: white, border-radius 0 0 8px 8px, padding 24px, NO shadow,
   and a 2-column grid of 237.29px tracks. The panel hangs flush off the header,
   not floating below it. */
.k4l-panel {
  position: absolute;
  top: 100%;
  left: -24px;
  background: var(--k4l-white);
  border: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.k4l-nav__item.is-open > .k4l-panel { opacity: 1; visibility: visible; transform: none; }

.k4l-panel__inner { padding: 24px; }

.k4l-panelgrid {
  display: grid;
  grid-template-columns: 237px 237px;
  column-gap: 24px;
  row-gap: 4px;
}

.k4l-panelrow {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-radius: 8px;
  color: var(--k4l-ink);
  font-size: var(--k4l-fs-base);
  font-weight: 500;
  line-height: 1.25;
}
.k4l-panelrow:hover { background: var(--k4l-purple-wash); color: var(--k4l-purple); }

.k4l-hex { flex: none; display: inline-flex; }
.k4l-hex__svg { width: 40px; height: 40px; }

.k4l-panelrow__label { min-width: 0; }

/* --- header actions ------------------------------------------------------ */
.k4l-header__actions { display: flex; align-items: center; gap: 18px; }

.k4l-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--k4l-ink);
  cursor: pointer;
  border-radius: 50%;
}
.k4l-iconbtn:hover { color: var(--k4l-purple-mid); background: var(--k4l-purple-wash); }

.k4l-cartbtn__count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--k4l-lime);
  color: var(--k4l-ink);
  font-size: var(--k4l-fs-xs);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* --- search bar ---------------------------------------------------------- */
.k4l-searchbar { border-top: 1px solid var(--k4l-border); padding: 16px 0; background: var(--k4l-white); }
.k4l-searchbar form { display: flex; gap: 10px; }
.k4l-searchbar__input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--k4l-border);
  border-radius: var(--k4l-radius);
  font: inherit;
}
.k4l-searchbar__input:focus { outline: 2px solid var(--k4l-purple-mid); outline-offset: -2px; }

/* --- burger (mobile) ----------------------------------------------------- */
.k4l-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 0;
  background: none;
  cursor: pointer;
}
.k4l-burger span { display: block; height: 2px; background: var(--k4l-ink); border-radius: 2px; }

/* --- cart drawer (the source off-canvas mini-cart) ----------------------- */
.k4l-drawer { position: fixed; inset: 0; z-index: 1000; }
.k4l-drawer[hidden] { display: none; }

.k4l-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(14, 8, 22, .45);
  animation: k4l-fade .2s ease;
}

.k4l-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(430px, 94vw);
  height: 100%;
  background: var(--k4l-white);
  display: flex;
  flex-direction: column;
  animation: k4l-slide .24s ease;
}

.k4l-drawer__close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: var(--k4l-purple);
  cursor: pointer;
}
.k4l-drawer__close svg { width: 20px; height: 20px; }

@keyframes k4l-fade  { from { opacity: 0; } }
@keyframes k4l-slide { from { transform: translateX(100%); } }

/* --- mini-cart (drawer body) --------------------------------------------- */
.k4l-minicart {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
}

.k4l-minicart__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}
.k4l-minicart__title { margin: 0; color: var(--k4l-purple); font-size: var(--k4l-fs-h3); }
.k4l-minicart__count { color: var(--k4l-ink-60); font-size: var(--k4l-fs-md); }

/* empty state */
.k4l-minicart__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding-top: 8px;
}
.k4l-minicart__emptymsg { margin: 0; color: var(--k4l-purple); font-size: var(--k4l-fs-md); font-weight: 500; }
.k4l-minicart__door { margin: 8px auto; }
.k4l-minicart__start {
  align-self: stretch;
  background: var(--k4l-purple);
  color: var(--k4l-white);
  border-radius: 4px;
}
.k4l-minicart__start svg { fill: currentColor; }
.k4l-minicart__start:hover { background: var(--k4l-purple-mid); color: var(--k4l-white); }

.k4l-minicart__trust {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  text-align: left;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.k4l-minicart__trust li { display: flex; align-items: center; gap: 10px; color: var(--k4l-ink); font-size: 14px; }
.k4l-minicart__trust svg { flex: none; color: var(--k4l-green); }

/* items state */
.k4l-minicart__items { display: flex; flex-direction: column; }
.k4l-minicart__item {
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 12px 0;
  border-bottom: 1px solid rgba(55, 36, 128, .2);
}
.k4l-minicart__thumb { flex: none; width: 80px; }
.k4l-minicart__thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.k4l-minicart__meta { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.k4l-minicart__name { color: var(--k4l-ink); font-size: var(--k4l-fs-md); font-weight: 300; }
.k4l-minicart__name:hover { color: var(--k4l-purple-mid); }
.k4l-minicart__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.k4l-minicart__stepper { display: inline-flex; align-items: center; gap: 4px; }
.k4l-minicart__step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 0; background: none;
  color: var(--k4l-purple); cursor: pointer;
}
.k4l-minicart__step:hover { color: var(--k4l-purple-mid); }
.k4l-minicart__step svg { width: 22px; height: 22px; }
.k4l-minicart__qty {
  min-width: 28px; text-align: center;
  font-family: var(--k4l-font-display); font-weight: 600; font-size: 20px;
  color: var(--k4l-purple);
}
.k4l-minicart__price,
.k4l-minicart__price .amount {
  font-family: var(--k4l-font-display); font-weight: 600; font-size: var(--k4l-fs-lg);
  color: var(--k4l-ink);
}
.k4l-minicart__price del { color: var(--k4l-grey-3); margin-right: 5px; }
.k4l-minicart__price ins { color: var(--k4l-green); text-decoration: none; }
.k4l-minicart__remove {
  flex: none; align-self: flex-start;
  width: 24px; height: 24px; border: 0; background: none;
  color: var(--k4l-grey-3); cursor: pointer;
}
.k4l-minicart__remove:hover { color: var(--k4l-purple); }
.k4l-minicart__item.is-busy { opacity: .5; pointer-events: none; }

/* items footer */
.k4l-minicart__foot { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.k4l-minicart__subtotal { display: flex; align-items: center; justify-content: space-between; }
.k4l-minicart__subtotallabel,
.k4l-minicart__subtotalval {
  font-family: var(--k4l-font-display); font-weight: 600; font-size: var(--k4l-fs-lg);
  color: var(--k4l-purple);
}
.k4l-minicart__checkout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 4px;
  background: var(--k4l-purple); color: var(--k4l-white);
  font-family: var(--k4l-font-display); font-weight: 600; font-size: var(--k4l-fs-lg);
}
.k4l-minicart__checkout svg { fill: currentColor; }
.k4l-minicart__checkout:hover { background: var(--k4l-purple-mid); color: var(--k4l-white); }

/* --- footer -------------------------------------------------------------- */
/* The source footer is the BRAND PURPLE (#372480 — measured on its inner
   .brxe-section, h=572), not a dark neutral. */
.k4l-footer { background: var(--k4l-purple); color: var(--k4l-white); padding-top: 64px; }

.k4l-footer__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-bottom: 56px;
}

.k4l-footer__brand img { filter: brightness(0) invert(1); width: 240px; }

.k4l-footer__h {
  font-size: var(--k4l-fs-base);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--k4l-purple-tint);
  margin-bottom: 16px;
}

.k4l-footer__col ul { list-style: none; margin: 0; padding: 0; }
.k4l-footer__col li { margin-bottom: 12px; }
.k4l-footer__col a { color: var(--k4l-white); font-size: var(--k4l-fs-base); font-weight: 500; }
.k4l-footer__col a:hover { color: var(--k4l-purple-tint); }

.k4l-footer__signuph {
  font-size: var(--k4l-fs-h4);
  color: var(--k4l-white);
  margin-bottom: 10px;
  max-width: 14ch;
}
.k4l-footer__signup p { color: rgba(255, 255, 255, .85); font-size: var(--k4l-fs-sm); }

/* Source: white field, light button with dark label — sitting on the purple band. */
.k4l-signup { display: flex; gap: 0; margin: 16px 0 12px; max-width: 380px; }
.k4l-signup input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--k4l-radius) 0 0 var(--k4l-radius);
  background: var(--k4l-white);
  color: var(--k4l-ink);
  font: inherit;
}
.k4l-signup input::placeholder { color: var(--k4l-grey-3); }
.k4l-signup .k4l-btn {
  border-radius: 0 var(--k4l-radius) var(--k4l-radius) 0;
  background: var(--k4l-grey-bg);
  color: var(--k4l-ink);
  font-size: var(--k4l-fs-base);
}
.k4l-signup .k4l-btn:hover { background: var(--k4l-purple-pale); color: var(--k4l-purple); }

.k4l-footer__fine { font-size: var(--k4l-fs-xs); color: rgba(255, 255, 255, .8); }
.k4l-footer__fine a { color: var(--k4l-white); text-decoration: underline; }

.k4l-footer__bar {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 20px 0;
  font-size: var(--k4l-fs-sm);
  color: rgba(255, 255, 255, .6);
}

/* ==========================================================================
   MOBILE NAV — sticky bottom bar + full-screen overlay (source, ≤991px).
   Bottom bar: floating purple pill (#372480), 16px side margins, bottom 8px,
   height 66px, radius 4px, 5 white icons. Overlay: full-screen white, flat
   bold-purple links with ↗ arrows + dividers.
   ========================================================================== */
.k4l-noscroll { overflow: hidden; }

.k4l-mobilebar { display: none; }
.k4l-mobilemenu[hidden] { display: none; }

/* --- sticky bottom bar --- */
.k4l-mobilebar__btn {
  position: relative;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 0;
  background: none;
  color: var(--k4l-white);
  cursor: pointer;
}
.k4l-mobilebar__btn svg { width: 24px; height: 24px; }
.k4l-mobilebar__count {
  position: absolute;
  top: 12px;
  left: calc(50% + 5px);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--k4l-lime);
  color: var(--k4l-purple);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* --- full-screen overlay --- */
.k4l-mobilemenu {
  position: fixed;
  inset: 0;
  z-index: 990;
  background: var(--k4l-white);
  padding: 72px 20px calc(66px + 32px);
  overflow-y: auto;
  animation: k4l-fade .18s ease;
}
.k4l-mobilemenu__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  color: var(--k4l-purple);
  cursor: pointer;
}
.k4l-mobilemenu__close svg { width: 26px; height: 26px; }
.k4l-mobilemenu__list { display: flex; flex-direction: column; }
.k4l-mobilemenu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--k4l-border);
  color: var(--k4l-purple);
  font-family: var(--k4l-font-display);
  font-size: 22px;
  font-weight: 600;
}
.k4l-mobilemenu__link:hover { color: var(--k4l-purple-mid); }
.k4l-mobilemenu__arrow { flex: none; color: var(--k4l-purple); }

/* --- responsive breakpoints --------------------------------------------- */
@media (max-width: 1100px) {
  .k4l-nav__list { gap: 24px; }
  .k4l-header__inner { gap: 24px; }
}

@media (max-width: 991px) {
  /* the bottom bar + overlay ARE the mobile nav — retire the desktop nav */
  .k4l-nav,
  .k4l-burger,
  .k4l-header__actions { display: none; }

  .k4l-header__inner { justify-content: center; gap: 12px; }
  .k4l-logo { margin: 0 auto; }

  .k4l-mobilebar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 8px;
    z-index: 999;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 12px;
    background: var(--k4l-purple);
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(14, 8, 22, .18);
  }

  /* reserve space at the very bottom so the floating bar never overlaps the
     footer's last row when scrolled all the way down */
  body { padding-bottom: 82px; }

  .k4l-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .k4l-footer__inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (min-width: 992px) {
  .k4l-mobilebar,
  .k4l-mobilemenu { display: none !important; }
}
