/* ==========================================================================
   KS Designs Sections — front end
   Every rule is scoped under .ks-sec / .ks-lb so nothing leaks into the theme.
   Colours and timings come from custom properties printed by class-assets.php.
   ========================================================================== */

.ks-sec {
  --ks-gap: 22px;
  box-sizing: border-box;
  width: 100%;
  padding: 56px 20px;
  background: var(--ks-bg, #faf7f5);
  color: var(--ks-dark, #22303c);
}

.ks-sec *,
.ks-sec *::before,
.ks-sec *::after { box-sizing: border-box; }

.ks-sec__inner {
  max-width: var(--ks-max, 1240px);
  margin-inline: auto;
}

.ks-sec--hero { padding-block: 32px; }
.ks-sec--empty { padding: 18px 20px; background: #fff8e5; }
.ks-sec__empty { margin: 0; font-size: 14px; color: #8a6d3b; }

/* --------------------------------------------------------------------------
   Section header
   -------------------------------------------------------------------------- */

.ks-sec__head { text-align: center; margin-bottom: 34px; }

.ks-sec__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ks-primary, #b5836a);
}

.ks-sec__title {
  position: relative;
  margin: 0;
  padding-bottom: 14px;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.18;
  font-weight: 700;
  color: var(--ks-dark, #22303c);
}

.ks-sec__rule {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 76px;
  height: 3px;
  border-radius: 3px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--ks-primary, #b5836a), transparent);
}

.ks-sec__sub {
  max-width: 640px;
  margin: 14px auto 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ks-muted, #6b6b6b);
}

.ks-sec__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 34px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.ks-sec .ks-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease,
              transform .25s ease, box-shadow .25s ease;
}

.ks-sec .ks-btn:focus-visible {
  outline: 2px solid var(--ks-primary, #b5836a);
  outline-offset: 3px;
}

.ks-sec .ks-btn--solid {
  background: var(--ks-primary, #b5836a);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45);
}
.ks-sec .ks-btn--solid:hover {
  background: var(--ks-primary-dk, #96684f);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .5);
}

.ks-sec .ks-btn--ghost {
  background: transparent;
  border-color: rgba(0, 0, 0, .14);
  color: var(--ks-dark, #22303c);
}
.ks-sec .ks-btn--ghost:hover {
  border-color: var(--ks-primary, #b5836a);
  color: var(--ks-primary, #b5836a);
  transform: translateY(-2px);
}
.ks-sec .ks-btn--ghost .ks-ico { transition: transform .25s ease; }
.ks-sec .ks-btn--ghost:hover .ks-ico { transform: translateX(4px); }

.ks-ico { width: 18px; height: 18px; flex: none; }

/* Load More spinner — only visible while a request is in flight. */
.ks-btn__spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ks-spin .7s linear infinite;
}
.ks-loadmore.is-loading { pointer-events: none; opacity: .75; }
.ks-loadmore.is-loading .ks-btn__spin { display: block; }

@keyframes ks-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Reveal-on-scroll engine
   JS adds .is-in once the element crosses the viewport.
   -------------------------------------------------------------------------- */

/* Everything here is gated on .ks-js, which a one-line inline script in <head>
   adds. If JavaScript is off or errors out, no element is ever left at
   opacity:0 — the sections simply render static. */

.ks-js .ks-anim {
  opacity: 0;
  transition:
    opacity   var(--ks-dur, 700ms) var(--ks-ease, ease),
    transform var(--ks-dur, 700ms) var(--ks-ease, ease);
  transition-delay: calc(var(--ks-i, 0) * var(--ks-stagger, 90ms));
}

.ks-js .ks-anim[data-ks-anim="fade-up"]     { transform: translate3d(0, 30px, 0); }
.ks-js .ks-anim[data-ks-anim="fade-in"]     { transform: none; }
.ks-js .ks-anim[data-ks-anim="zoom-in"]     { transform: scale(.93); }
.ks-js .ks-anim[data-ks-anim="slide-left"]  { transform: translate3d(-40px, 0, 0); }
.ks-js .ks-anim[data-ks-anim="slide-right"] { transform: translate3d(40px, 0, 0); }

.ks-js .ks-anim.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   1. Hero offer slider
   -------------------------------------------------------------------------- */

.ks-hero { position: relative; }

.ks-hero__viewport {
  overflow: hidden;
  border-radius: var(--ks-hero-radius, 18px);
  background: rgba(0, 0, 0, .04);
}

.ks-hero__track {
  display: flex;
  will-change: transform;
}

.ks-hero__slide {
  flex: 0 0 100%;
  min-width: 100%;
}

.ks-hero__slide picture,
.ks-hero__link { display: block; }

.ks-hero__slide img {
  display: block;
  width: 100%;
  height: auto;
}

/* Slide transition */
.ks-hero--slide .ks-hero__track {
  transition: transform 600ms var(--ks-ease, cubic-bezier(.22, .68, 0, 1));
}
.ks-hero.is-dragging .ks-hero__track { transition: none; }

/* Fade transition — every slide stacks in the same cell. */
.ks-hero--fade .ks-hero__track { display: grid; }
.ks-hero--fade .ks-hero__slide {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 600ms var(--ks-ease, ease);
  pointer-events: none;
}
.ks-hero--fade .ks-hero__slide.is-active { opacity: 1; pointer-events: auto; }

/* Controls row: ‹  • • • •  ›      ▶ */
.ks-hero__ctrls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.ks-hero__arrow,
.ks-hero__pp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ks-dark, #22303c);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.ks-hero__arrow:hover,
.ks-hero__pp:hover {
  background: rgba(0, 0, 0, .06);
  color: var(--ks-primary, #b5836a);
}
.ks-hero__arrow:focus-visible,
.ks-hero__pp:focus-visible,
.ks-hero__dot:focus-visible {
  outline: 2px solid var(--ks-primary, #b5836a);
  outline-offset: 2px;
}

.ks-hero__pp { margin-left: 10px; }
.ks-hero__pp .ks-hero__pp-pause { display: none; }
.ks-hero__pp[aria-pressed="true"] .ks-hero__pp-play { display: none; }
.ks-hero__pp[aria-pressed="true"] .ks-hero__pp-pause { display: inline-flex; }

.ks-hero__dots { display: flex; align-items: center; gap: 10px; }

.ks-hero__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1.5px solid rgba(0, 0, 0, .25);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.ks-hero__dot:hover { border-color: var(--ks-dark, #22303c); }
.ks-hero__dot.is-active {
  background: var(--ks-dark, #22303c);
  border-color: var(--ks-dark, #22303c);
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   2. Browse categories
   -------------------------------------------------------------------------- */

.ks-cats { position: relative; }

.ks-cats__track {
  display: grid;
  gap: 18px;
}

.ks-cats--grid .ks-cats__track {
  grid-template-columns: repeat(var(--ks-cols, 7), minmax(0, 1fr));
}

.ks-cats--scroll .ks-cats__track {
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--ks-cols, 7) - 1) * 18px) / var(--ks-cols, 7));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px 10px;
}
.ks-cats--scroll .ks-cats__track::-webkit-scrollbar { display: none; }
.ks-cats--scroll .ks-cat { scroll-snap-align: start; }

.ks-cat {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.ks-cat__img {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--ks-radius, 14px) - 4px);
  background: rgba(0, 0, 0, .05);
}

.ks-cat__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ks-ease, ease);
}
.ks-cat:hover .ks-cat__img img { transform: scale(1.07); }

.ks-cat__name {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ks-dark, #22303c);
  transition: color .2s ease;
}
.ks-cat:hover .ks-cat__name { color: var(--ks-primary, #b5836a); }

.ks-cat__count {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ks-muted, #6b6b6b);
}

/* Scroll arrows */
.ks-scroll-btn {
  position: absolute;
  top: calc(50% - 26px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: #fff;
  color: var(--ks-dark, #22303c);
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .4);
  transform: translateY(-50%);
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.ks-scroll-btn:hover { background: var(--ks-primary, #b5836a); color: #fff; }
.ks-scroll-btn[hidden] { display: none; }
.ks-scroll-btn--prev { left: -14px; }
.ks-scroll-btn--next { right: -14px; }

/* --------------------------------------------------------------------------
   3 + 4. Product grids
   -------------------------------------------------------------------------- */

.ks-grid {
  display: grid;
  grid-template-columns: repeat(var(--ks-cols, 4), minmax(0, 1fr));
  gap: var(--ks-gap);
}

.ks-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: var(--ks-radius, 14px);
  background: var(--ks-card, #fff);
  transition: transform .35s var(--ks-ease, ease), box-shadow .35s var(--ks-ease, ease),
              border-color .35s ease;
}
.ks-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 0, 0, .04);
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, .45);
}

.ks-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, .04);
}

.ks-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ks-ease, ease), opacity .45s ease;
}
.ks-card__img--alt { opacity: 0; }
.ks-card:hover .ks-card__img { transform: scale(1.06); }
.ks-card:hover .ks-card__img--alt { opacity: 1; }

.ks-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ks-sale, #d32f2f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.ks-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 14px;
}

.ks-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ks-dark, #22303c);
}
.ks-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}
.ks-card__title a:hover { color: var(--ks-primary, #b5836a); }

.ks-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ks-muted, #6b6b6b);
}

.ks-card__stock {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ks-sale, #d32f2f);
}

.ks-card__foot {
  display: flex;
  /* Wrap rather than overflow: the card clips its content, so a rating that
     cannot fit beside the price would otherwise be cut in half. */
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

/* Deliberately normal inline flow, not flex. WooCommerce renders a variable
   product as "<amount> – <amount>", and as a flex container the dash and each
   amount become separate items that stack once the card gets narrow. */
.ks-card__price {
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ks-dark, #22303c);
}
.ks-card__price del {
  margin-right: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ks-muted, #6b6b6b);
  opacity: .85;
}
.ks-card__price ins {
  text-decoration: none;
  background: transparent;
  color: inherit;
}
.ks-card__price .woocommerce-Price-currencySymbol { font-weight: inherit; }

/* Keep each amount whole; only allow a break between the ends of a range. */
.ks-card__price .woocommerce-Price-amount { white-space: nowrap; }

/* Woo emits "Original price was: …" for screen readers. Most themes hide it,
   but not all, and left visible it doubles the price text inside the card. */
.ks-card__price .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ks-card__rating {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--ks-muted, #6b6b6b);
  white-space: nowrap;
}
.ks-star { width: 14px; height: 14px; fill: var(--ks-star, #e8b931); }
.ks-card__rating-avg { font-weight: 600; color: var(--ks-star, #e8b931); }

/* --------------------------------------------------------------------------
   Carousel
   Slide count, gap and navigation visibility come from a per-instance <style>
   block printed by the renderer, so tablet and mobile can genuinely override
   desktop. Everything here is the shared chrome.
   -------------------------------------------------------------------------- */

.ks-car { position: relative; }
.ks-car__frame { position: relative; }

.ks-car__viewport {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(
    (100% - (var(--ks-car-show, 4) - 1) * var(--ks-car-gap, 24px)) / var(--ks-car-show, 4)
  );
  gap: var(--ks-car-gap, 24px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  /* Left to the script: it animates scrollLeft itself so the configured
     Animation Speed is honoured. Native smooth scrolling ignores duration. */
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Room for the card hover lift and its shadow, which would otherwise be
     clipped by the scroll container. */
  padding: 6px 2px 12px;
}
.ks-car__viewport::-webkit-scrollbar { display: none; }

.ks-car__viewport > * {
  scroll-snap-align: start;
  min-width: 0;
}

/* Mandatory snap and a script-driven scroll fight each other: the snap engine
   keeps re-targeting while the animation is mid-flight, and that tug-of-war is
   what reads as stutter. Snap is suspended for the duration of a scripted move
   and while dragging, then restored so touch keeps its native snapping. */
.ks-car.is-animating .ks-car__viewport,
.ks-car.is-dragging .ks-car__viewport {
  scroll-snap-type: none;
}

.ks-car.is-dragging .ks-car__viewport {
  cursor: grabbing;
  user-select: none;
}
/* Cards must not swallow the drag as an image drag or a stray click. */
.ks-car.is-dragging .ks-car__viewport a,
.ks-car.is-dragging .ks-car__viewport img {
  pointer-events: none;
}

/* "Slides per view auto" — each slide is as wide as its content. */
.ks-car.is-auto .ks-car__viewport { grid-auto-columns: max-content; }

.ks-car__arrow {
  position: absolute;
  top: calc(50% - 8px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: #fff;
  color: var(--ks-dark, #22303c);
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5);
  transform: translateY(-50%);
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.ks-car__arrow:hover { background: var(--ks-primary, #b5836a); color: #fff; }
.ks-car__arrow:focus-visible {
  outline: 2px solid var(--ks-primary, #b5836a);
  outline-offset: 2px;
}
.ks-car__arrow--prev { left: -18px; }
.ks-car__arrow--next { right: -18px; }

/* Disabled rather than removed, so the row does not jump as you reach an end. */
.ks-car__arrow[disabled] {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

.ks-car__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
}
.ks-car__dots:empty { display: none; }

.ks-car__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1.5px solid rgba(0, 0, 0, .25);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, transform .25s ease, width .25s ease;
}
.ks-car__dot:hover { border-color: var(--ks-dark, #22303c); }
.ks-car__dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--ks-primary, #b5836a);
  border-color: var(--ks-primary, #b5836a);
}
.ks-car__dot:focus-visible {
  outline: 2px solid var(--ks-primary, #b5836a);
  outline-offset: 2px;
}

/* Without the script the track is still a swipeable row, so the arrows would
   be dead controls — they are only shown once the script takes over. */
.ks-car:not(.is-ready) .ks-car__arrow { display: none; }

@media (max-width: 1100px) {
  .ks-car__arrow--prev { left: -6px; }
  .ks-car__arrow--next { right: -6px; }
}

@media (max-width: 767px) {
  .ks-car__viewport { padding-bottom: 8px; }
  .ks-car__arrow { width: 34px; height: 34px; }
  .ks-car__arrow--prev { left: -4px; }
  .ks-car__arrow--next { right: -4px; }
  .ks-car__dots { margin-top: 14px; }
}

/* --------------------------------------------------------------------------
   6. Product tabs
   -------------------------------------------------------------------------- */

.ks-tabs__nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 34px;
  margin-bottom: 30px;
  padding-bottom: 10px;
}
.ks-tabs--center .ks-tabs__nav { justify-content: center; }
.ks-tabs--left   .ks-tabs__nav { justify-content: flex-start; }

.ks-tabs__btn {
  position: relative;
  padding: 6px 2px;
  border: 0;
  background: none;
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ks-muted, #6b6b6b);
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s ease;
}
.ks-tabs__btn:hover { color: var(--ks-dark, #22303c); }
.ks-tabs__btn.is-active { color: var(--ks-dark, #22303c); font-weight: 700; }
.ks-tabs__btn:focus-visible {
  outline: 2px solid var(--ks-primary, #b5836a);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Underline that slides between tabs. Positioned by JS; when JS is unavailable
   the active button keeps its own static underline instead (below). */
.ks-tabs__ink {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--ks-dark, #22303c);
  transform: translateX(0);
  transition: transform .35s var(--ks-ease, ease), width .35s var(--ks-ease, ease);
  pointer-events: none;
}
html:not(.ks-js) .ks-tabs__ink { display: none; }
html:not(.ks-js) .ks-tabs__btn.is-active {
  box-shadow: inset 0 -2px 0 0 var(--ks-dark, #22303c);
}

.ks-tabs__panel[hidden] { display: none; }

/* Only plays when the visitor switches tabs — JS adds the class, so the panel
   rendered with the page is not double-animated against the card reveal. */
.ks-tabs__panel.is-enter { animation: ks-tab-in var(--ks-dur, 700ms) var(--ks-ease, ease) both; }

@keyframes ks-tab-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}

.ks-tabs__empty {
  margin: 0;
  padding: 30px 0;
  text-align: center;
  color: var(--ks-muted, #6b6b6b);
}

/* Skeleton shown while a tab is being fetched */
.ks-skel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 14px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: var(--ks-radius, 14px);
  background: var(--ks-card, #fff);
  overflow: hidden;
}

.ks-skel {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .055) 25%,
    rgba(0, 0, 0, .095) 37%,
    rgba(0, 0, 0, .055) 63%);
  background-size: 400% 100%;
  animation: ks-shimmer 1.4s ease infinite;
}
.ks-skel--img  { aspect-ratio: 1 / 1; width: 100%; }
.ks-skel--line { height: 12px; margin: 0 14px; border-radius: 4px; }
.ks-skel--line.is-short { width: 45%; }

@keyframes ks-shimmer {
  from { background-position: 100% 50%; }
  to   { background-position: 0 50%; }
}

/* --------------------------------------------------------------------------
   5. Creative portfolio
   -------------------------------------------------------------------------- */

.ks-port {
  padding: 40px 32px 44px;
  border-radius: calc(var(--ks-radius, 14px) + 8px);
  background: rgba(255, 255, 255, .55);
}

.ks-port__grid {
  display: grid;
  grid-template-columns: repeat(var(--ks-cols, 3), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  grid-auto-flow: dense;
  gap: 16px;
}

.ks-port__item {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: calc(var(--ks-radius, 14px) - 2px);
  background: rgba(0, 0, 0, .05);
  cursor: pointer;
  transition: transform .4s var(--ks-ease, ease), box-shadow .4s var(--ks-ease, ease);
}
.ks-port__item.is-large {
  grid-row: span 2;
  aspect-ratio: auto;
  height: 100%;
}
.ks-port__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .55);
}
.ks-port__item:focus-visible {
  outline: 3px solid var(--ks-primary, #b5836a);
  outline-offset: 2px;
}

.ks-port__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ks-ease, ease);
}
.ks-port__item:hover .ks-port__img { transform: scale(1.06); }

.ks-port__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  color: var(--ks-primary, #b5836a);
  transform: translate(-50%, -50%);
  transition: transform .3s var(--ks-ease, ease), background-color .3s ease;
}
.ks-port__play::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .55);
  animation: ks-ripple 2.4s var(--ks-ease, ease) infinite;
}
.ks-port__item:hover .ks-port__play {
  background: #fff;
  transform: translate(-50%, -50%) scale(1.1);
}

@keyframes ks-ripple {
  0%   { transform: scale(.9); opacity: .9; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.ks-port__cap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 30px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Card actions — quick view / wishlist / WhatsApp
   -------------------------------------------------------------------------- */

.ks-card { position: relative; }

.ks-card__actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ks-act {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--ks-dark, #22303c);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .5);
  /* Hidden until hover on pointer devices; always visible on touch (below). */
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .25s ease, transform .25s ease, background-color .2s ease, color .2s ease;
}
.ks-act svg { width: 18px; height: 18px; }
.ks-act:hover { background: var(--ks-primary, #b5836a); color: #fff; }
.ks-act:focus-visible {
  opacity: 1;
  transform: none;
  outline: 2px solid var(--ks-primary, #b5836a);
  outline-offset: 2px;
}

.ks-card:hover .ks-act,
.ks-card:focus-within .ks-act { opacity: 1; transform: none; }

/* Stagger them in, cheaply. */
.ks-card:hover .ks-act:nth-child(2) { transition-delay: .04s; }
.ks-card:hover .ks-act:nth-child(3) { transition-delay: .08s; }

.ks-act--wish.is-on { background: var(--ks-sale, #d32f2f); color: #fff; }
.ks-act--wish.is-on svg { fill: currentColor; }
.ks-act--wa:hover { background: #25d366; color: #fff; }

.ks-act__tip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  padding: 4px 9px;
  border-radius: 5px;
  background: rgba(20, 18, 17, .9);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.ks-act:hover .ks-act__tip { opacity: 1; transform: translateY(-50%); }

/* Touch devices have no hover, so the buttons must simply be there. */
@media (hover: none) {
  .ks-act { opacity: 1; transform: none; }
  .ks-act__tip { display: none; }
}

/* Add to cart */
.ks-card__cart { margin-top: 10px; }

.ks-sec .ks-card__cart .ks-btn--cart,
.ks-sec .ks-card__cart .button {
  display: flex;
  width: 100%;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--ks-primary, #b5836a);
  border-radius: 999px;
  background: transparent;
  color: var(--ks-primary, #b5836a);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}
.ks-sec .ks-card__cart .ks-btn--cart:hover,
.ks-sec .ks-card__cart .button:hover {
  background: var(--ks-primary, #b5836a);
  color: #fff;
}

/* WooCommerce's own loading/added states on the AJAX button. */
.ks-sec .ks-card__cart .button.loading { opacity: .7; pointer-events: none; }
.ks-sec .ks-card__cart .button.added { background: var(--ks-primary, #b5836a); color: #fff; }
.ks-sec .ks-card__cart .added_to_cart {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  text-align: center;
  color: var(--ks-muted, #6b6b6b);
}

/* --------------------------------------------------------------------------
   Countdown
   -------------------------------------------------------------------------- */

.ks-count {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.ks-count__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
  padding: 10px 8px;
  border-radius: calc(var(--ks-radius, 14px) - 4px);
  background: var(--ks-card, #fff);
  box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .5);
}
.ks-count__num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ks-dark, #22303c);
}
.ks-count__label {
  margin-top: 4px;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ks-muted, #6b6b6b);
}

.ks-count--big .ks-count__unit { min-width: 84px; padding: 16px 12px; }
.ks-count--big .ks-count__num { font-size: 38px; }

.ks-count__done {
  margin: 0;
  text-align: center;
  font-weight: 600;
  color: var(--ks-muted, #6b6b6b);
}

/* Compact variant that sits on a product card. */
.ks-card__timer {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 18, 17, .82);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.ks-card__timer:empty { display: none; }
.ks-card__media { position: relative; }

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

.ks-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.ks-filter__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ks-pill {
  padding: 8px 16px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: transparent;
  color: var(--ks-muted, #6b6b6b);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.ks-pill:hover { border-color: var(--ks-primary, #b5836a); color: var(--ks-primary, #b5836a); }
.ks-pill.is-active {
  background: var(--ks-primary, #b5836a);
  border-color: var(--ks-primary, #b5836a);
  color: #fff;
}
.ks-pill:focus-visible { outline: 2px solid var(--ks-primary, #b5836a); outline-offset: 2px; }

.ks-filter__sort select {
  padding: 9px 14px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  background: var(--ks-card, #fff);
  color: var(--ks-dark, #22303c);
  font-size: 13.5px;
  cursor: pointer;
}

[data-ks-swap] { transition: opacity .2s ease; }
[data-ks-swap].is-busy { opacity: .45; pointer-events: none; }

.ks-sec__none {
  margin: 0;
  padding: 30px 0;
  text-align: center;
  color: var(--ks-muted, #6b6b6b);
}

/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */

.ks-testi {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 26px 24px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: var(--ks-radius, 14px);
  background: var(--ks-card, #fff);
  height: 100%;
  box-sizing: border-box;
}

.ks-testi__stars { display: flex; gap: 2px; }
.ks-testi__stars .ks-star { width: 16px; height: 16px; fill: var(--ks-star, #e8b931); }
.ks-testi__stars .ks-star.is-off { fill: rgba(0, 0, 0, .14); }

.ks-testi__text {
  flex: 1;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ks-dark, #22303c);
}
.ks-testi__text::before { content: "\201C"; }
.ks-testi__text::after { content: "\201D"; }

.ks-testi__who {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}

.ks-testi__photo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.ks-testi__photo--letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ks-primary, #b5836a);
  color: #fff;
  font-weight: 700;
}

.ks-testi__meta { display: flex; flex-direction: column; min-width: 0; }
.ks-testi__name { font-size: 14px; font-weight: 700; color: var(--ks-dark, #22303c); }
.ks-testi__role {
  font-size: 12px;
  color: var(--ks-muted, #6b6b6b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Quick View
   -------------------------------------------------------------------------- */

.ks-qv {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 12, 11, .82);
  opacity: 0;
  transition: opacity .25s ease;
}
.ks-qv[hidden] { display: none; }
.ks-qv.is-open { opacity: 1; }

.ks-qv__panel {
  position: relative;
  width: min(940px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: calc(var(--ks-radius, 14px) + 4px);
  background: var(--ks-card, #fff);
  transform: translateY(14px) scale(.985);
  transition: transform .28s var(--ks-ease, ease);
}
.ks-qv.is-open .ks-qv__panel { transform: none; }

.ks-qv__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .06);
  color: var(--ks-dark, #22303c);
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.ks-qv__close svg { width: 18px; height: 18px; }
.ks-qv__close:hover { background: rgba(0, 0, 0, .12); transform: rotate(90deg); }

.ks-qv__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  padding: 28px;
}

.ks-qv__stage {
  overflow: hidden;
  border-radius: var(--ks-radius, 14px);
  background: rgba(0, 0, 0, .04);
  aspect-ratio: 1 / 1;
}
.ks-qv__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ks-qv__thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ks-qv__thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.ks-qv__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ks-qv__thumb.is-active { border-color: var(--ks-primary, #b5836a); }

.ks-qv__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ks-qv__title { margin: 0; font-size: 24px; line-height: 1.25; color: var(--ks-dark, #22303c); }
.ks-qv__rating { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ks-muted, #6b6b6b); }
.ks-qv__price { font-size: 22px; font-weight: 700; color: var(--ks-dark, #22303c); }
.ks-qv__price del { font-size: 15px; font-weight: 500; color: var(--ks-muted, #6b6b6b); margin-right: 6px; }
.ks-qv__price ins { text-decoration: none; background: none; color: inherit; }
.ks-qv__desc { font-size: 14px; line-height: 1.65; color: var(--ks-muted, #6b6b6b); }
.ks-qv__desc p { margin: 0 0 8px; }
.ks-qv__oos { font-weight: 600; color: var(--ks-sale, #d32f2f); }
.ks-qv__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.ks-btn--wa { background: #25d366; border-color: #25d366; color: #fff; }
.ks-btn--wa:hover { background: #1eb355; border-color: #1eb355; color: #fff; }

.ks-qv__loading {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--ks-muted, #6b6b6b);
}

/* Woo's add-to-cart form inside the panel */
.ks-qv__form .quantity { margin-right: 10px; }
.ks-qv__form .button,
.ks-qv__form button[type="submit"] {
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--ks-primary, #b5836a);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.ks-qv__form .button:hover { background: var(--ks-primary-dk, #96684f); }

@media (max-width: 767px) {
  .ks-qv { padding: 12px; }
  .ks-qv__grid { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; }
  .ks-qv__title { font-size: 20px; }
  .ks-qv__price { font-size: 19px; }
  .ks-filter { justify-content: flex-start; }
  .ks-filter__pills { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ks-filter__pills::-webkit-scrollbar { display: none; }
  .ks-testi { padding: 20px 18px; }
  .ks-count--big .ks-count__unit { min-width: 68px; padding: 12px 8px; }
  .ks-count--big .ks-count__num { font-size: 28px; }
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.ks-lb {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(14, 12, 11, .92);
  opacity: 0;
  transition: opacity .28s ease;
}
.ks-lb[hidden] { display: none; }
.ks-lb.is-open { opacity: 1; }

.ks-lb__stage {
  max-width: min(1100px, 100%);
  max-height: 88vh;
  transform: scale(.96);
  transition: transform .28s var(--ks-ease, ease);
}
.ks-lb.is-open .ks-lb__stage { transform: scale(1); }

.ks-lb__stage img,
.ks-lb__stage video {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: 10px;
}

.ks-lb__stage iframe {
  display: block;
  width: min(1100px, 88vw);
  aspect-ratio: 16 / 9;
  max-height: 88vh;
  border: 0;
  border-radius: 10px;
}

.ks-lb__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.ks-lb__close:hover { background: rgba(255, 255, 255, .28); transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .ks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ks-cats--grid .ks-cats__track { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ks-cats--scroll .ks-cats__track { grid-auto-columns: calc((100% - 3 * 18px) / 4); }
}

@media (max-width: 820px) {
  .ks-sec { padding: 44px 16px; }
  .ks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-port__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-port { padding: 28px 18px 32px; }
  .ks-cats--grid .ks-cats__track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ks-cats--scroll .ks-cats__track { grid-auto-columns: calc((100% - 2 * 18px) / 3); }
  .ks-scroll-btn { display: none; }
}

@media (max-width: 560px) {
  .ks-sec { --ks-gap: 14px; padding: 34px 14px; }
  .ks-sec__head { margin-bottom: 24px; }
  .ks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-cats--grid .ks-cats__track,
  .ks-cats--scroll .ks-cats__track { grid-auto-columns: calc((100% - 14px) / 2.35); gap: 14px; }
  .ks-cats--grid .ks-cats__track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ks-port__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ks-port__item.is-large { grid-row: span 1; aspect-ratio: 1 / 1; height: auto; }
  .ks-card__body { padding: 12px 12px 11px; gap: 5px; }
  .ks-card__title { font-size: 14px; }
  .ks-card__excerpt { font-size: 12px; }
  .ks-card__stock { font-size: 11.5px; }

  /* Two cards to a row leaves roughly 150px of usable width, which is not
     enough for price and rating side by side — stack them instead of letting
     the price break across three lines. */
  .ks-card__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding-top: 10px;
  }
  .ks-card__price { font-size: 15px; }
  .ks-card__rating { font-size: 11.5px; }

  .ks-sec .ks-btn { padding: 11px 22px; font-size: 14px; }
  .ks-hero__ctrls { gap: 8px; }

  /* Tab strips can outgrow a phone, so they scroll sideways instead of wrapping
     into a stack that pushes the products off screen. */
  .ks-tabs__nav {
    flex-wrap: nowrap;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .ks-tabs__nav::-webkit-scrollbar { display: none; }
  .ks-tabs--center .ks-tabs__nav { justify-content: flex-start; }
}

/* Very narrow phones (320px class). Two cards still fit, but a variable
   product's "₹200.00 – ₹220.00" needs the extra few pixels to stay on one line. */
@media (max-width: 360px) {
  .ks-sec { padding-left: 10px; padding-right: 10px; }
  .ks-card__body { padding: 10px; }
  .ks-card__price { font-size: 14px; }
  .ks-cat__name { font-size: 13px; }
}

/* --------------------------------------------------------------------------
   Reduced motion — honour the OS setting, no exceptions.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ks-anim,
  .ks-anim.is-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .ks-sec *,
  .ks-lb * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .ks-port__play::after { display: none; }
}
