/* ================================================================
   KALAI — SHARED SITE SHELL (v2 layout)
   Used by the redesigned pages: index.html, product.html,
   lookbook.html. Contains design tokens, header, mobile menu,
   search, buttons, product cards, sliders, newsletter, footer and
   the lightbox / video modal.

   Loaded together with cart.css (bag drawer + toast). It does NOT
   load styles.css, so the older pages are unaffected.
   ================================================================ */

:root {
  /* Colour */
  --k-bg: #f4f0ea;
  --k-bg-2: #ece6dd;
  --k-header: #f2eee8;
  --k-ink: #16130f;
  --k-ink-2: #3a332c;
  --k-muted: #6f675e;
  --k-line: #ddd5ca;
  --k-dark: #12100d;
  --k-white: #ffffff;

  /* Type */
  --k-display: 'Forum', 'Times New Roman', serif;
  --k-serif: 'Lora', Georgia, serif;
  --k-italic: 'Cormorant Garamond', Georgia, serif;
  --k-sans: 'Inter', Helvetica, Arial, sans-serif;

  /* Layout */
  --k-max: 1320px;
  --k-pad: 64px;
  --k-header-h: 76px;
  --k-ease: cubic-bezier(.22, .61, .36, 1);

  /* Variables cart.css relies on (normally from styles.css) */
  --ink: #16130f;
  --ink-soft: #3a332c;
  --cream: #f4f0ea;
  --cream-2: #ece6dd;
  --white: #ffffff;
  --line: #ddd5ca;
  --olive: #94a077;
  --rust: #8a4a34;
  --radius-sm: 2px;
  --radius-md: 4px;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--k-sans);
  color: var(--k-ink);
  background: var(--k-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 1px solid var(--k-ink); outline-offset: 3px; }

.k-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.k-wrap {
  width: 100%;
  max-width: var(--k-max);
  margin: 0 auto;
  padding: 0 var(--k-pad);
}

.k-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Type helpers ---------------- */
.k-eyebrow {
  display: block;
  font-family: var(--k-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.k-h2 {
  font-family: var(--k-display);
  font-weight: 400;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.k-h3 {
  font-family: var(--k-serif);
  font-weight: 400;
  font-size: clamp(17px, 1.4vw, 20px);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.k-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.k-link-arrow svg { width: 15px; height: 15px; transition: transform .25s var(--k-ease); }
.k-link-arrow:hover svg { transform: translateX(4px); }

/* ---------------- Buttons ---------------- */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 30px;
  border: 1px solid currentColor;
  font-family: var(--k-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.k-btn svg { width: 15px; height: 15px; transition: transform .25s var(--k-ease); }
.k-btn:hover svg { transform: translateX(3px); }

.k-btn--light { color: #fff; border-color: rgba(255, 255, 255, .85); }
.k-btn--light:hover { background: #fff; color: var(--k-ink); }

.k-btn--ink { color: var(--k-ink); border-color: var(--k-ink); }
.k-btn--ink:hover { background: var(--k-ink); color: #fff; }

.k-btn--solid { background: var(--k-ink); border-color: var(--k-ink); color: #fff; }
.k-btn--solid:hover { background: #2c2620; border-color: #2c2620; }
.k-btn--solid:disabled { opacity: .45; cursor: not-allowed; }

/* ================================================================
   HEADER
   ================================================================ */
.k-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--k-header);
  border-bottom: 1px solid rgba(22, 19, 15, .06);
}

.k-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--k-header-h);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(24px, 8vw, 150px);
}

.k-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-self: start;
  line-height: 1;
  color: var(--k-ink);
}
.k-logo__word {
  font-family: var(--k-display);
  font-size: 30px;
  letter-spacing: .2em;
  margin-right: -.2em;
}
.k-logo__sub {
  margin-top: 4px;
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: .42em;
  margin-right: -.42em;
  text-transform: uppercase;
}

.k-nav { display: flex; align-items: center; gap: clamp(22px, 3vw, 46px); }
.k-nav a {
  position: relative;
  padding: 8px 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.k-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--k-ease);
}
.k-nav a:hover::after,
.k-nav a[aria-current="page"]::after { transform: scaleX(1); }

.k-header__icons { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.k-header__icons button,
.k-header__icons a { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.k-header__icons .k-icon { width: 21px; height: 21px; }

.k-header__menu { display: none; width: 28px; height: 28px; align-items: center; justify-content: flex-start; }
.k-header__menu .k-icon { width: 24px; height: 24px; }

/* Cart badge (cart.js writes the count into #cartBadge) */
.k-bag { position: relative; }
.k-bag .cart-badge {
  position: absolute;
  top: -3px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--k-ink);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}
.k-bag .cart-badge:empty,
.k-bag .cart-badge[data-zero="true"] { display: none; }
.k-bag .cart-badge.bump { animation: kBadge .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes kBadge { 45% { transform: scale(1.35); } }

/* ---------------- Mobile menu ---------------- */
.k-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
}
.k-menu.open { visibility: visible; pointer-events: auto; }
.k-menu__scrim {
  position: absolute; inset: 0;
  background: rgba(18, 16, 13, .42);
  opacity: 0;
  transition: opacity .35s ease;
}
.k-menu.open .k-menu__scrim { opacity: 1; }
.k-menu__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(380px, 86vw);
  display: flex;
  flex-direction: column;
  padding: 22px 28px 32px;
  background: var(--k-bg);
  transform: translateX(-100%);
  transition: transform .45s var(--k-ease);
  overflow-y: auto;
}
.k-menu.open .k-menu__panel { transform: none; }
.k-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.k-menu__close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.k-menu nav a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--k-line);
  font-family: var(--k-display);
  font-size: 24px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.k-menu nav a[aria-current="page"] { color: var(--k-muted); }
.k-menu__foot { margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; color: var(--k-muted); }

/* ---------------- Search ---------------- */
.k-search {
  position: fixed;
  inset: 0;
  z-index: 210;
  visibility: hidden;
  pointer-events: none;
}
.k-search.open { visibility: visible; pointer-events: auto; }
.k-search__scrim { position: absolute; inset: 0; background: rgba(18, 16, 13, .35); opacity: 0; transition: opacity .3s ease; }
.k-search.open .k-search__scrim { opacity: 1; }
.k-search__panel {
  position: relative;
  background: var(--k-bg);
  padding: 34px 0 40px;
  transform: translateY(-100%);
  transition: transform .45s var(--k-ease);
  max-height: 88vh;
  overflow-y: auto;
}
.k-search.open .k-search__panel { transform: none; }
.k-search__form { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--k-ink); }
.k-search__form input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--k-display);
  font-size: clamp(24px, 3vw, 34px);
}
.k-search__results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 24px 16px;
  margin-top: 28px;
}
.k-search__empty { margin-top: 22px; font-family: var(--k-serif); font-size: 15px; color: var(--k-muted); }

/* ================================================================
   PRODUCT CARD + SLIDER (shared by New In / You May Also Like)
   ================================================================ */
.k-card { display: block; min-width: 0; }
.k-card__img {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--k-bg-2);
}
.k-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  transition: transform .9s var(--k-ease);
}
.k-card:hover .k-card__img img { transform: scale(1.04); }
.k-card__badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 5px 8px;
  background: rgba(244, 240, 234, .94);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.k-card__name {
  margin-top: 14px;
  font-family: var(--k-serif);
  font-size: 15px;
  line-height: 1.3;
}
.k-card__cat { margin-top: 4px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--k-muted); }
.k-card__price { margin-top: 5px; font-family: var(--k-serif); font-size: 14px; color: var(--k-ink-2); }

/* Sale: normal price struck through, sale price after it (cards + product page) */
.k-price-was { margin-right: 6px; color: var(--k-muted); font-weight: 400; text-decoration-thickness: 1px; }
.k-price-now { color: #8a4a34; }
.k-card__swatches { display: flex; gap: 6px; margin-top: 12px; }
.k-card__swatches span {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(22, 19, 15, .14);
}

.k-slider { position: relative; }
.k-slider__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--k-cols, 6) - 1) * var(--k-gap, 20px)) / var(--k-cols, 6));
  gap: var(--k-gap, 20px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.k-slider__track::-webkit-scrollbar { display: none; }
.k-slider__track > * { scroll-snap-align: start; }

.k-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--k-ink);
  transition: opacity .2s ease, transform .2s ease;
}
.k-arrow .k-icon { width: 22px; height: 22px; stroke-width: 1.2; }
.k-arrow:hover:not(:disabled) { transform: scale(1.08); }
.k-arrow:disabled { opacity: .25; cursor: default; }

/* Arrows that sit in the page margin outside the track */
.k-slider__prev,
.k-slider__next {
  position: absolute;
  top: var(--k-arrow-top, 38%);
  transform: translateY(-50%);
  z-index: 3;
}
.k-slider__prev { left: calc(var(--k-pad) * -1 + 6px); }
.k-slider__next { right: calc(var(--k-pad) * -1 + 6px); }
.k-slider__prev:hover:not(:disabled),
.k-slider__next:hover:not(:disabled) { transform: translateY(-50%) scale(1.08); }

/* Arrows drawn as small round chips over the track (mobile) */
.k-chip-arrow {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.k-chip-arrow .k-icon { width: 17px; height: 17px; }

.k-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

/* Graceful image placeholder (set by KalaiSite.imgFallback) */
.k-ph { background: linear-gradient(135deg, #e7dfd3, #d6cbbb); }

/* ================================================================
   NEWSLETTER + FOOTER
   ================================================================ */
.k-footer { background: var(--k-bg); }
.k-newsletter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 0 34px;
  border-bottom: 1px solid var(--k-line);
}
.k-newsletter h2 {
  font-family: var(--k-display);
  font-weight: 400;
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1.1;
}
.k-newsletter p { margin-top: 4px; font-family: var(--k-serif); font-size: 15px; color: var(--k-ink-2); }
.k-newsletter > div:last-child { flex: 0 0 min(620px, 50%); }
.k-newsletter form { display: flex; gap: 12px; width: 100%; }
.k-newsletter input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--k-line);
  background: rgba(255, 255, 255, .35);
  outline: none;
  font-family: var(--k-serif);
  font-size: 14px;
}
.k-newsletter input:focus { border-color: var(--k-ink); }
.k-newsletter .k-btn { min-height: 50px; padding: 0 44px; }
.k-newsletter__msg { margin-top: 10px; font-size: 13px; color: var(--k-ink-2); min-height: 1em; }

.k-footer__main {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)) auto;
  gap: 32px;
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--k-line);
}
.k-footer__main .k-logo__word { font-size: 34px; }
.k-footer h3 {
  margin-bottom: 12px;
  font-family: var(--k-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.k-footer li + li { margin-top: 8px; }
.k-footer li a { font-family: var(--k-serif); font-size: 14px; color: var(--k-ink-2); }
.k-footer li a:hover { color: var(--k-ink); text-decoration: underline; text-underline-offset: 3px; }
.k-socials { display: flex; align-items: center; gap: 20px; align-self: center; }
.k-socials a { display: flex; }
.k-socials svg { width: 22px; height: 22px; fill: var(--k-ink); }
.k-socials svg.k-ig { fill: none; stroke: var(--k-ink); stroke-width: 1.7; }
.k-socials svg.k-ig .dot { fill: var(--k-ink); stroke: none; }

.k-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 0 26px;
  font-family: var(--k-serif);
  font-size: 13px;
  color: var(--k-ink-2);
}
.k-footer__bottom nav { display: flex; gap: 34px; }

/* Bag drawer typography to match the v2 pages */
.cart-header h2,
.cart-empty p { font-family: var(--k-display); font-weight: 400; }
.cart-header .k-eyebrow { font-size: 10px; color: var(--k-muted); }

/* ================================================================
   LIGHTBOX + VIDEO MODAL
   ================================================================ */
.k-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 8, .94);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.k-modal.open { opacity: 1; visibility: visible; }
.k-modal__close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.k-modal__close .k-icon { width: 26px; height: 26px; }
.k-modal__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px;
}
.k-modal__stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.k-modal__stage .k-zoomable { overflow: auto; max-width: 100%; max-height: 100%; touch-action: pan-x pan-y pinch-zoom; }
.k-modal__stage .k-zoomable img { max-width: none; max-height: none; width: min(1100px, 180vw); }
.k-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  color: #fff;
}
.k-modal__nav.prev { left: 16px; }
.k-modal__nav.next { right: 16px; }
.k-modal__count {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  letter-spacing: .2em;
}
.k-modal__caption {
  position: absolute;
  bottom: 22px; left: 28px;
  color: #fff;
  font-family: var(--k-serif);
  font-size: 15px;
}
.k-modal__video { width: min(1200px, 100%); aspect-ratio: 16 / 9; background: #000; }
.k-modal__video iframe,
.k-modal__video video { width: 100%; height: 100%; border: 0; }

/* Round play button used on video panels */
.k-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
  color: #fff;
  backdrop-filter: blur(2px);
  transition: transform .3s var(--k-ease), background .3s ease;
}
.k-play svg { width: 26px; height: 26px; margin-left: 4px; fill: #fff; }
.k-play:hover { transform: scale(1.06); background: rgba(0, 0, 0, .32); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1180px) {
  :root { --k-pad: 48px; }
  .k-header__inner { padding: 0 32px; }
  .k-nav { gap: 22px; }
  .k-footer__main { grid-template-columns: 1fr 1fr 1fr; }
  .k-footer__brand { grid-column: 1 / -1; }
  .k-socials { grid-column: 1 / -1; align-self: start; }
}

@media (max-width: 960px) {
  :root { --k-pad: 28px; --k-header-h: 64px; }
  .k-header__inner { grid-template-columns: 1fr auto 1fr; padding: 0 20px; }
  .k-header__menu { display: flex; }
  .k-nav { display: none; }
  .k-logo { justify-self: center; }
  .k-logo__word { font-size: 26px; }
  .k-header__account { display: none !important; }
  .k-header__icons { gap: 14px; }

  .k-newsletter { flex-direction: column; align-items: stretch; gap: 20px; }
  .k-newsletter > div:last-child { flex: none; width: 100%; }

  .k-slider__prev, .k-slider__next { display: none; }

  /* Edge-to-edge swipe tracks with a peek of the next item */
  .k-slider--bleed .k-slider__track {
    margin: 0 calc(var(--k-pad) * -1);
    padding: 0 var(--k-pad);
    scroll-padding: 0 var(--k-pad);
  }
}

@media (max-width: 600px) {
  :root { --k-pad: 20px; }
  .k-section-head { margin-bottom: 18px; }
  .k-newsletter form { flex-direction: column; }
  .k-newsletter input { flex: none; }
  .k-newsletter .k-btn { width: 100%; }
  .k-footer__main { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .k-footer__bottom { flex-direction: column; }
  .k-footer__bottom nav { gap: 22px; flex-wrap: wrap; }
  .k-modal__stage { padding: 60px 12px; }
  .k-modal__nav.prev { left: 4px; }
  .k-modal__nav.next { right: 4px; }
  .k-play { width: 64px; height: 64px; }
  .k-play svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
