/* Kuflik Storefront v3
   Szuflada koszyka, stany dodawania do koszyka, poprawki strony koszyka i kart produktów.
   Ruch: przepisy Transitions.dev wklejone bez zmian (sekcja 2); własne kompozycje korzystają
   wyłącznie z tokenów (sekcja 1). Zasada kształtu: 3px kontrolki, 6px zdjęcia i pola,
   12px pływające powierzchnie (16px górne rogi arkusza mobilnego, jak karty koszyka). */

/* ==========================================================================
   1. Tokeny marki i ruchu
   ========================================================================== */
:root {
  --ksf-bg: #fffdf8;
  --ksf-surface: #fbf8f2;
  --ksf-surface-2: #f4eee4;
  --ksf-line: #eadfce;
  --ksf-line-strong: #e3d5bd;
  --ksf-text: #252321;
  --ksf-muted: #5d544b;
  --ksf-accent: #755225;
  --ksf-accent-hover: #63431d;
  --ksf-accent-tint: #f0e7d8;
  --ksf-success: #2f4f35;
  --ksf-success-tint: #e4ead9;
  --ksf-danger: #9b2c2c;
  --ksf-scrim: rgba(28, 24, 20, 0.42);
  --ksf-radius-control: 3px;
  --ksf-radius-media: 6px;
  --ksf-radius-surface: 12px;
  --ksf-shadow: 0 28px 64px -28px rgba(37, 35, 33, 0.45), 0 2px 10px rgba(37, 35, 33, 0.08);
  --ksf-font: var(--kuflik-font-sans, "Kuflik Manrope", "Manrope", system-ui, sans-serif);

  /* Transitions.dev: tokeny używane przez własne kompozycje. */
  --duration-quick: 150ms;
  --duration-fast: 250ms;
  --duration-very-slow: 500ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);
  --ease-linear: linear;
  --blur-small: 2px;

  /* 07 Panel reveal */
  --panel-open-dur: 400ms;
  --panel-close-dur: 350ms;
  --panel-translate-y: 100px;
  --panel-blur: 2px;
  --panel-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 02 Number pop-in */
  --digit-dur: 500ms;
  --digit-distance: 8px;
  --digit-stagger: 70ms;
  --digit-blur: 2px;
  --digit-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
  --digit-dir-x: 0;
  --digit-dir-y: 1;

  /* 04 Text states swap */
  --text-swap-dur: 150ms;
  --text-swap-translate-y: 4px;
  --text-swap-blur: 2px;
  --text-swap-ease: ease-in-out;

  /* 09 Icon swap */
  --icon-swap-dur: 250ms;
  --icon-swap-blur: 2px;
  --icon-swap-start-scale: 0.25;
  --icon-swap-ease: ease-in-out;

  /* 10 Success check */
  --check-opacity-dur: 500ms;
  --check-rotate-dur: 500ms;
  --check-rotate-from: 80deg;
  --check-bob-dur: 500ms;
  --check-y-amount: 40px;
  --check-blur-dur: 500ms;
  --check-blur-from: 10px;
  --check-path-dur: 500ms;
  --check-path-delay: 80ms;
  --check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1);
  --check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);

  /* 12 Error state shake */
  --shake-distance: 6px;
  --shake-overshoot: 4px;
  --shake-dur-a: 80ms;
  --shake-dur-b: 60ms;
  --shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --revert-hold: 3000ms;
  --revert-dur: 280ms;

  /* 14 Skeleton loader and reveal */
  --pulse-dur: 1000ms;
  --pulse-count: infinite;
  --pulse-min: 0.5;
  --reveal-dur: 400ms;
  --reveal-blur: 2px;
  --reveal-ease: ease-in-out;

  /* 18 Texts reveal */
  --stagger-dur: 500ms;
  --stagger-distance: 12px;
  --stagger-stagger: 40ms;
  --stagger-blur: 3px;
  --stagger-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 21 Accordion expand (te same wartości co w kuflik-sekret-variant2.css) */
  --acc-expand: 250ms;
  --acc-collapse: 250ms;
  --acc-chevron: 250ms;
  --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 22 Toast */
  --toast-open: 350ms;
  --toast-close: 250ms;
  --toast-distance: 16px;
  --toast-blur: 2px;
  --toast-scale: 0.97;
  --toast-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   2. Przepisy Transitions.dev (bez zmian)
   ========================================================================== */

/* 07 Panel reveal */
.t-panel-slide {
  transform: translateY(var(--panel-translate-y));
  opacity: 0;
  filter: blur(var(--panel-blur));
  pointer-events: none;
  transition:
    transform var(--panel-close-dur) var(--panel-ease),
    opacity   var(--panel-close-dur) var(--panel-ease),
    filter    var(--panel-close-dur) var(--panel-ease);
  will-change: transform, opacity, filter;
}
.t-panel-slide[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  transition:
    transform var(--panel-open-dur) var(--panel-ease),
    opacity   var(--panel-open-dur) var(--panel-ease),
    filter    var(--panel-open-dur) var(--panel-ease);
}
@media (prefers-reduced-motion: reduce) {
  .t-panel-slide { transition: none !important; }
}

/* 02 Number pop-in */
@keyframes t-digit-pop-in {
  0%   {
    transform: translate(
      calc(var(--digit-distance) * var(--digit-dir-x)),
      calc(var(--digit-distance) * var(--digit-dir-y))
    );
    opacity: 0;
    filter: blur(var(--digit-blur));
  }
  100% { transform: translate(0, 0); opacity: 1; filter: blur(0); }
}
.t-digit-group {
  display: inline-flex;
  align-items: baseline;
}
.t-digit {
  display: inline-block;
  will-change: transform, opacity, filter;
}
.t-digit-group.is-animating .t-digit {
  animation: t-digit-pop-in var(--digit-dur) var(--digit-ease) both;
}
.t-digit-group.is-animating .t-digit[data-stagger="1"] {
  animation-delay: var(--digit-stagger);
}
.t-digit-group.is-animating .t-digit[data-stagger="2"] {
  animation-delay: calc(var(--digit-stagger) * 2);
}
@media (prefers-reduced-motion: reduce) {
  .t-digit-group .t-digit { animation: none !important; }
}

/* 04 Text states swap */
.t-text-swap {
  display: inline-block;
  transform: translateY(0);
  filter: blur(0);
  opacity: 1;
  transition:
    transform var(--text-swap-dur) var(--text-swap-ease),
    filter    var(--text-swap-dur) var(--text-swap-ease),
    opacity   var(--text-swap-dur) var(--text-swap-ease);
  will-change: transform, filter, opacity;
}
.t-text-swap.is-exit {
  transform: translateY(calc(var(--text-swap-translate-y) * -1));
  filter: blur(var(--text-swap-blur));
  opacity: 0;
}
.t-text-swap.is-enter-start {
  transform: translateY(var(--text-swap-translate-y));
  filter: blur(var(--text-swap-blur));
  opacity: 0;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .t-text-swap { transition: none !important; }
}

/* 09 Icon swap */
.t-icon-swap {
  position: relative;
  display: inline-grid;
}
.t-icon-swap .t-icon {
  grid-area: 1 / 1;
  transition:
    opacity   var(--icon-swap-dur) var(--icon-swap-ease),
    filter    var(--icon-swap-dur) var(--icon-swap-ease),
    transform var(--icon-swap-dur) var(--icon-swap-ease);
  will-change: opacity, filter, transform;
}
.t-icon-swap[data-state="a"] .t-icon[data-icon="a"],
.t-icon-swap[data-state="b"] .t-icon[data-icon="b"] {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}
.t-icon-swap[data-state="a"] .t-icon[data-icon="b"],
.t-icon-swap[data-state="b"] .t-icon[data-icon="a"] {
  opacity: 0;
  filter: blur(var(--icon-swap-blur));
  transform: scale(var(--icon-swap-start-scale));
}
@media (prefers-reduced-motion: reduce) {
  .t-icon-swap .t-icon { transition: none !important; }
}

/* 10 Success check */
.t-success-check {
  display: inline-block;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}
.t-success-check svg { display: block; overflow: visible; }
.t-success-check svg path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.t-success-check[data-state="in"] {
  animation:
    t-check-fade   var(--check-opacity-dur) var(--check-ease-opacity) forwards,
    t-check-rotate var(--check-rotate-dur)  var(--check-ease-rotate)  forwards,
    t-check-blur   var(--check-blur-dur)    var(--check-ease-out)     forwards,
    t-check-bob    var(--check-bob-dur)     var(--check-ease-bob)     forwards;
}
.t-success-check[data-state="in"] svg path {
  animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}
@keyframes t-check-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes t-check-rotate {
  from { transform: rotate(var(--check-rotate-from)); }
  to   { transform: rotate(0deg); }
}
@keyframes t-check-blur {
  from { filter: blur(var(--check-blur-from)); }
  to   { filter: blur(0); }
}
@keyframes t-check-bob {
  from { translate: 0 var(--check-y-amount); }
  to   { translate: 0 0; }
}
@keyframes t-check-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .t-success-check { animation: none !important; opacity: 1; }
  .t-success-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
}
/* Kalibracja: Lucide Check "M20 6 9 17l-5-5" ma długość 22,63 → 24. */
.ksf-ship .t-success-check svg path,
.ksf-add-check svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

/* 12 Error state shake */
.t-input {
  transition: border-color 150ms ease-out;
  will-change: transform;
}
.t-input.is-error {
  transition: border-color var(--revert-dur, 280ms) ease-out;
}
.t-error-msg {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear var(--revert-dur, 280ms);
}
.t-input-wrap.is-error .t-error-msg {
  opacity: 1;
  visibility: visible;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear 0s;
}
.t-input.is-shaking {
  animation: t-input-shake calc(
      var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2
    ) linear;
}
@keyframes t-input-shake {
  0%      { transform: translateX(0);                                 animation-timing-function: var(--shake-ease); }
  28.57%  { transform: translateX(var(--shake-distance));             animation-timing-function: var(--shake-ease); }
  57.14%  { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
  78.57%  { transform: translateX(var(--shake-overshoot));            animation-timing-function: var(--shake-ease); }
  100%    { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .t-input { animation: none !important; transform: none !important; }
}

/* 14 Skeleton loader and reveal */
.t-skel { position: relative; }
.t-skel-skeleton,
.t-skel-content {
  position: absolute;
  inset: 0;
}
.t-skel-skeleton {
  z-index: 1;
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--reveal-dur) var(--reveal-ease),
    filter  var(--reveal-dur) var(--reveal-ease);
}
.t-skel-content {
  z-index: 2;
  opacity: 0;
  filter: blur(var(--reveal-blur));
  transition:
    opacity var(--reveal-dur) var(--reveal-ease),
    filter  var(--reveal-dur) var(--reveal-ease);
}
.t-skel.is-revealed .t-skel-skeleton {
  opacity: 0;
  filter: blur(var(--reveal-blur));
}
.t-skel.is-revealed .t-skel-content {
  opacity: 1;
  filter: blur(0);
}
.t-skel.is-resetting .t-skel-skeleton,
.t-skel.is-resetting .t-skel-content {
  transition: none !important;
}
.t-skel-skeleton.is-pulsing > * {
  animation: t-skel-pulse var(--pulse-dur) ease-in-out var(--pulse-count);
}
@keyframes t-skel-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: var(--pulse-min); }
}
@media (prefers-reduced-motion: reduce) {
  .t-skel-skeleton, .t-skel-content {
    transition: none !important;
  }
  .t-skel-skeleton.is-pulsing > * { animation: none !important; }
}

/* 18 Texts reveal */
.t-stagger-line {
  display: block;
  opacity: 0;
  transform: translateY(var(--stagger-distance));
  filter: blur(var(--stagger-blur));
  transition:
    opacity   var(--stagger-dur) var(--stagger-ease),
    transform var(--stagger-dur) var(--stagger-ease),
    filter    var(--stagger-dur) var(--stagger-ease);
  will-change: transform, opacity, filter;
}
.t-stagger-line--2 { transition-delay: var(--stagger-stagger); }
.t-stagger.is-shown .t-stagger-line {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.t-stagger.is-hiding .t-stagger-line {
  opacity: 0;
  transform: translateY(0);
  filter: blur(0);
  transition:
    opacity 200ms ease,
    transform 0s linear,
    filter 0s linear;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .t-stagger-line { transition: none !important; }
}

/* 21 Accordion expand (panel; bez nagłówka i strzałki) */
.t-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel {
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--acc-expand) var(--acc-ease);
}
.t-acc-panel-inner {
  overflow: hidden;
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--acc-collapse) var(--acc-ease),
    filter var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel-inner {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--acc-expand) var(--acc-ease),
    filter var(--acc-expand) var(--acc-ease);
}
@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron {
    transition: none !important;
  }
}

/* 22 Toast open / close */
.t-toast {
  opacity: 0;
  transform: translateY(var(--toast-distance)) scale(var(--toast-scale));
  filter: blur(var(--toast-blur));
  will-change: transform, opacity, filter;
  transition:
    opacity var(--toast-close) var(--toast-ease),
    transform var(--toast-close) var(--toast-ease),
    filter var(--toast-close) var(--toast-ease);
}
.t-toast.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity var(--toast-open) var(--toast-ease),
    transform var(--toast-open) var(--toast-ease),
    filter var(--toast-open) var(--toast-ease);
}
@media (prefers-reduced-motion: reduce) {
  .t-toast { transition: none !important; }
}

/* ==========================================================================
   3. Szuflada koszyka
   ========================================================================== */
html.ksf-scroll-lock,
html.ksf-scroll-lock body {
  overflow: hidden !important;
}
html.ksf-scroll-lock.ksf-gutter { scrollbar-gutter: stable; }

.ksf-drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  font-family: var(--ksf-font);
  color: var(--ksf-text);
  -webkit-font-smoothing: antialiased;
}
.ksf-drawer[hidden] { display: none !important; }
.ksf-drawer *,
.ksf-drawer *::before,
.ksf-drawer *::after { box-sizing: border-box; }

.ksf-drawer__scrim {
  position: absolute;
  inset: 0;
  background: var(--ksf-scrim);
  opacity: 0;
  transition: opacity var(--panel-close-dur) var(--panel-ease);
  touch-action: none;
}
.ksf-drawer[data-open="true"] .ksf-drawer__scrim {
  opacity: 1;
  transition: opacity var(--panel-open-dur) var(--panel-ease);
}

.ksf-drawer__panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(440px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ksf-bg);
  border: 1px solid var(--ksf-line);
  border-radius: var(--ksf-radius-surface);
  box-shadow: var(--ksf-shadow);
  outline: none;
}

.ksf-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px 10px 22px;
}
.ksf-drawer__title {
  margin: 0;
  font-family: var(--ksf-font);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--ksf-text);
  text-transform: none;
}
.ksf-drawer__count {
  margin-left: 4px;
  font-weight: 600;
  color: var(--ksf-muted);
  font-variant-numeric: tabular-nums;
}
.ksf-drawer__count[hidden] { display: none; }

.ksf-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}

.ksf-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ksf-radius-control);
  background: transparent;
  color: var(--ksf-muted);
  cursor: pointer;
  transition:
    background-color var(--duration-quick) ease-out,
    color var(--duration-quick) ease-out;
}
.ksf-icon-button:focus-visible,
.ksf-button:focus-visible,
.ksf-link:focus-visible,
.ksf-stepper__button:focus-visible,
.ksf-undo:focus-visible,
.ksf-line__name:focus-visible {
  outline: 2px solid var(--ksf-accent);
  outline-offset: 2px;
}
@media (hover: hover) {
  .ksf-icon-button:hover {
    background: var(--ksf-surface-2);
    color: var(--ksf-text);
  }
}

/* Darmowa dostawa */
.ksf-ship {
  margin: 2px 22px 6px;
  padding: 12px 14px 13px;
  border-radius: var(--ksf-radius-media);
  background: var(--ksf-surface);
  transition: background-color var(--duration-fast) var(--ease-smooth-out);
}
.ksf-ship[data-state="hidden"] { display: none; }
.ksf-ship[data-state="done"] { background: var(--ksf-success-tint); }
.ksf-ship__text {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ksf-text);
}
.ksf-ship[data-state="done"] .ksf-ship__text { color: var(--ksf-success); }
.ksf-ship__icons {
  width: 20px;
  height: 20px;
  color: var(--ksf-accent);
}
.ksf-ship[data-state="done"] .ksf-ship__icons { color: var(--ksf-success); }
.ksf-ship__icons .t-icon,
.ksf-ship__icons .t-success-check { display: block; width: 20px; height: 20px; }
/* Przepis 10 w skali ikony 20px: krótszy podskok i mniejsze rozmycie startowe. */
.ksf-ship,
.single_add_to_cart_button {
  --check-y-amount: 10px;
  --check-blur-from: 4px;
}
/* Stan bez animacji: szuflada otwarta przy już osiągniętej darmowej dostawie. */
.t-success-check[data-state="static"] { opacity: 1; }
.t-success-check[data-state="static"] svg path { stroke-dashoffset: 0; }
.ksf-ship__track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: var(--ksf-radius-control);
  background: var(--ksf-line);
}
.ksf-ship__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ksf-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition:
    transform var(--duration-very-slow) var(--ease-smooth-out),
    background-color var(--duration-fast) var(--ease-smooth-out);
}
.ksf-ship[data-state="done"] .ksf-ship__fill { background: var(--ksf-success); }
@media (prefers-reduced-motion: reduce) {
  .ksf-ship,
  .ksf-ship__fill { transition: none !important; }
}

/* Lista pozycji */
.ksf-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 22px 8px;
  scrollbar-width: thin;
}
.ksf-skel:not(.is-settled) { min-height: 208px; }
.ksf-skel.is-settled .t-skel-skeleton { display: none; }
.ksf-skel.is-settled .t-skel-content { position: static; }

.ksf-skel-row {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ksf-line);
}
.ksf-skel-lines {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.ksf-skel-block {
  display: block;
  height: 12px;
  width: 72%;
  border-radius: var(--ksf-radius-control);
  background: var(--ksf-surface-2);
}
.ksf-skel-block--media {
  width: 72px;
  height: 72px;
  border-radius: var(--ksf-radius-media);
  flex: none;
}
.ksf-skel-block--short { width: 46%; }
.ksf-skel-block--tiny { width: 30%; margin-top: 8px; height: 30px; }

.ksf-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ksf-line {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--ksf-line);
}
.ksf-line:last-child { border-bottom: 0; }
.ksf-line.is-collapsing { border-bottom-color: transparent; }
/* Przycisk usuwania wychodzi optycznie 6 px poza wiersz, a drżenie (przepis 12) przesuwa treść
   o kolejne 6 px. Szersze pole przycięcia akordeonu mieści oba przesunięcia, więc wiersza nie da
   się przewinąć w poziomie (fokus z klawiatury) i tło przycisku przy najechaniu nie jest ucinane. */
.ksf-line .t-acc-panel-inner {
  margin-inline: -12px;
  padding-inline: 12px;
}
.ksf-line__body { position: relative; }
.ksf-line__content {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px;
  align-items: start;
  gap: 14px;
  padding: 16px 0;
}
/* Wiersz jest celem przepisu 12 (.t-input); zanikanie przy usuwaniu korzysta z wartości przepisu 22. */
.ksf-line__content.t-input,
.ksf-line__content.t-input.is-error {
  transition:
    opacity var(--toast-close) var(--toast-ease),
    filter var(--toast-close) var(--toast-ease);
}
.ksf-line.is-removing .ksf-line__content {
  opacity: 0;
  filter: blur(var(--toast-blur));
  pointer-events: none;
}
.ksf-line__media {
  display: block;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: var(--ksf-radius-media);
  background: var(--ksf-surface-2);
}
.ksf-line__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.ksf-line.is-arriving .ksf-line__media img { visibility: hidden; }
.ksf-line.is-landed .ksf-line__media {
  animation: ksf-landed var(--duration-very-slow) var(--ease-bounce);
}
@keyframes ksf-landed {
  0% { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.ksf-line__info { min-width: 0; padding-top: 1px; }
.ksf-line__info .t-stagger-line { display: block; }
.ksf-line__info .ksf-line__row.t-stagger-line { display: flex; }
.ksf-line__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ksf-text);
  text-decoration: none;
}
@media (hover: hover) {
  .ksf-line__name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
.ksf-line__meta {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ksf-muted);
}
.ksf-line__row {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.ksf-line__total {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ksf-line__remove { margin: -6px -6px 0 0; }
@media (hover: hover) {
  .ksf-line__remove:hover {
    background: #f7e9e6;
    color: var(--ksf-danger);
  }
}
.ksf-line__error:empty { display: none; }
.ksf-line__error {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ksf-danger);
}

/* Licznik ilości */
.ksf-stepper {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--ksf-line-strong);
  border-radius: var(--ksf-radius-control);
  background: #fff;
}
.ksf-stepper[hidden] { display: none; }
.ksf-stepper__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ksf-radius-control);
  background: transparent;
  color: var(--ksf-text);
  cursor: pointer;
  transition: background-color var(--duration-quick) ease-out, color var(--duration-quick) ease-out;
}
.ksf-stepper__button .ksf-icon { width: 16px; height: 16px; }
.ksf-stepper__button:disabled {
  color: #c9bba6;
  cursor: default;
}
@media (hover: hover) {
  .ksf-stepper__button:not(:disabled):hover { background: var(--ksf-surface-2); }
}
.ksf-stepper__value {
  display: inline-flex;
  justify-content: center;
  min-width: 30px;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ksf-line.is-busy .ksf-stepper { border-color: var(--ksf-accent-tint); }

/* Cofnięcie usunięcia */
.ksf-line__undo {
  position: absolute;
  inset: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  padding: 0 6px 0 14px;
  border-radius: var(--ksf-radius-media);
  background: var(--ksf-surface);
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ksf-muted);
  pointer-events: none;
}
.ksf-line__undo.is-open { pointer-events: auto; }
.ksf-line__undo-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ksf-line__undo-text strong { color: var(--ksf-text); font-weight: 600; }
.ksf-undo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--ksf-radius-control);
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--ksf-accent);
  cursor: pointer;
  white-space: nowrap;
}
.ksf-undo .ksf-icon { width: 17px; height: 17px; }
@media (hover: hover) {
  .ksf-undo:hover { background: var(--ksf-accent-tint); }
}
.ksf-line__undo-timer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--ksf-accent);
  opacity: 0.55;
  transform: scaleX(0);
  transform-origin: left center;
}
.ksf-line__undo-timer.is-running {
  animation-name: ksf-undo-timer;
  animation-timing-function: var(--ease-linear);
  animation-fill-mode: forwards;
}
@keyframes ksf-undo-timer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ksf-line__content { transition: none !important; }
  .ksf-line.is-landed .ksf-line__media { animation: none !important; }
  .ksf-line__undo-timer.is-running { animation: none !important; }
}

/* Pusty koszyk */
.ksf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 12px 36px;
  text-align: center;
}
.ksf-empty[hidden] { display: none; }
.ksf-empty .t-stagger-line { display: block; }
.ksf-empty__icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--ksf-surface-2);
  color: var(--ksf-accent);
}
.ksf-empty__icon .ksf-icon { width: 26px; height: 26px; }
.ksf-empty__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ksf-text);
}
.ksf-empty__text {
  max-width: 30ch;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ksf-muted);
}
.ksf-empty .ksf-button { display: inline-flex !important; width: auto; padding: 0 22px; }

/* Stopka */
.ksf-drawer__foot {
  flex: none;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ksf-line);
  background: var(--ksf-bg);
}
.ksf-drawer__foot[hidden] { display: none; }
.ksf-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.ksf-total__label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ksf-muted);
}
.ksf-total__value {
  font-size: 21px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ksf-text);
}
.ksf-total__note {
  margin: 4px 0 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ksf-muted);
}
.ksf-total__note[hidden] { display: none; }
.ksf-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--ksf-radius-control);
  font-family: var(--ksf-font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none !important;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color var(--duration-quick) ease-out,
    border-color var(--duration-quick) ease-out,
    color var(--duration-quick) ease-out;
}
.ksf-button--primary,
.ksf-button--primary:visited {
  background: var(--ksf-accent);
  color: #fff !important;
}
.ksf-button--secondary,
.ksf-button--secondary:visited {
  border-color: var(--ksf-line-strong);
  background: #fff;
  color: var(--ksf-text) !important;
}
.ksf-button .ksf-icon {
  width: 18px;
  height: 18px;
  transition: transform var(--duration-fast) var(--ease-smooth-out);
}
@media (hover: hover) {
  .ksf-button--primary:hover { background: var(--ksf-accent-hover); }
  .ksf-button--secondary:hover { border-color: var(--ksf-accent); }
  .ksf-button:hover .ksf-icon { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .ksf-button .ksf-icon { transition: none !important; }
}
.ksf-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ksf-text) !important;
  text-decoration: underline;
  text-decoration-color: var(--ksf-line-strong);
  text-underline-offset: 4px;
}
@media (hover: hover) {
  .ksf-link:hover { text-decoration-color: var(--ksf-accent); }
}

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

/* Lot zdjęcia do koszyka */
.ksf-fly {
  position: fixed !important;
  z-index: 100001;
  display: block;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover;
  border-radius: var(--ksf-radius-media);
  box-shadow: 0 18px 36px -14px rgba(37, 35, 33, 0.5);
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform, filter, opacity;
}

/* Arkusz od dołu na telefonach */
@media (max-width: 767px) {
  .ksf-drawer__panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: calc(100% - 56px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }
  .ksf-drawer__head { padding: 12px 10px 8px 18px; }
  .ksf-ship { margin: 2px 18px 6px; }
  .ksf-drawer__body { padding: 0 18px 8px; }
  .ksf-drawer__foot { padding: 14px 18px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .ksf-line__content { grid-template-columns: 64px minmax(0, 1fr) 40px; gap: 12px; }
  .ksf-line__media { width: 64px; height: 64px; }
  .ksf-stepper { height: 40px; }
  .ksf-stepper__button { width: 40px; height: 38px; }
}

/* ==========================================================================
   4. Nagłówek: koszyk Porto otwiera szufladę
   ========================================================================== */
html.kuflik-sf-drawer-enabled #mini-cart .cart-popup,
html.kuflik-sf-drawer-enabled #mini-cart .cart-icon::after {
  display: none !important;
}
html.kuflik-sf-js #mini-cart .cart-items.count-updating { animation: none; }
html.kuflik-sf-js #mini-cart .cart-items .t-digit-group {
  display: inline-flex;
  justify-content: center;
  line-height: inherit;
}
html.kuflik-sf-drawer-enabled #mini-cart .cart-head:focus-visible {
  outline: 2px solid var(--ksf-accent);
  outline-offset: 3px;
  border-radius: var(--ksf-radius-control);
}
/* Szuflada przejmuje potwierdzenie dodania: bez podwójnych komunikatów. */
html.kuflik-sf-drawer-open .kuflik-cart-success-notice { visibility: hidden !important; }
html.kuflik-sf-drawer-enabled .after-loading-success-message { display: none !important; }

/* ==========================================================================
   5. Strona produktu: stany przycisku „Dodaj do koszyka”
   ========================================================================== */
.single_add_to_cart_button .ksf-add-label { display: inline-block; }
.single_add_to_cart_button .ksf-add-check {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  vertical-align: -3px;
}
.single_add_to_cart_button .ksf-add-check .ksf-icon { width: 18px; height: 18px; }
.single_add_to_cart_button[data-ksf-state="success"] .ksf-add-check { display: inline-block; }
.single_add_to_cart_button[aria-busy="true"] { cursor: progress; }
/* 12 Error shake na przycisku: animacja z przepisu bez klasy .t-input, która nadpisałaby przejścia motywu. */
.single_add_to_cart_button.is-shaking {
  animation: t-input-shake calc(var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2) linear;
}
@media (prefers-reduced-motion: reduce) {
  .single_add_to_cart_button.is-shaking { animation: none !important; }
}
form.cart .ksf-form-error:empty { display: none; }
form.cart .ksf-form-error {
  flex-basis: 100%;
  width: 100%;
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ksf-danger);
}

/* ==========================================================================
   6. Strona koszyka
   ========================================================================== */
/* Ilości przeliczają się same (Enter w polu ilości obsługuje WooCommerce), więc przycisk
   znika także z kolejności fokusu. Bez JavaScriptu klasa nie powstaje i przycisk zostaje. */
.woocommerce-cart-form.ksf-auto-update button[name="update_cart"] {
  display: none !important;
}
.ksf-ship__track--page {
  max-width: 420px;
  margin-top: 10px;
}
.ksf-ship__track--page .ksf-ship__fill { background: var(--ksf-accent); }

/* ==========================================================================
   7. Karty produktów i drobne poprawki w całym sklepie
   ========================================================================== */
/* Rząd ocen na kartach zostaje bez zmian: należy do bloku PRODUCT CARD RATING V1
   w kuflik-ux-conversion.css (display: block !important, także dla pustych ocen). */

/* Etykieta „Nowość” w kolorach marki zamiast domyślnego koloru motywu. */
.products .product .labels .onnew,
.product .labels .onnew {
  padding: 6px 9px 5px;
  border-radius: var(--ksf-radius-control);
  background: var(--ksf-accent);
  color: #fff;
  font-family: var(--ksf-font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: none;
}

