/* ===========================================================
   Wysuwany koszyk — wygląd z makiety ("Twój zapas").
   Panel jest Blocksy (#woo-cart-panel), środek nasz (.ww-mc).

   Przedrostek :is(#woo-cart-panel, …) daje regułom siłę "identyfikatora",
   żeby wygrywały ze stylami motywu dla koszyka. Druga część (.ct-panel
   z naszym koszykiem w środku) to zapas, gdyby panel miał inną nazwę.
   Kolory i kroje pism biorą się z ww-tokens.css.
   =========================================================== */

/* --- Panel: tło, szerokość, nakładka bez rozmycia ---------- */

:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) {
  background-color: rgba(22, 16, 11, .5);
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-inner {
  --side-panel-width: min(420px, 92vw);
  width: min(420px, 92vw);
  max-width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .4);
}

/* --- Nagłówek: "Twój zapas" i okrągły przycisk zamknięcia --- */

:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-actions {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight, 800);
  font-size: 22px; line-height: 1.1;
  letter-spacing: var(--display-spacing, -0.03em);
  text-transform: none;
  color: var(--ink);
}
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-toggle-close {
  --theme-icon-color: var(--ink);
  --theme-icon-hover-color: var(--ink);
  flex: none;
  width: 36px; height: 36px;
  margin: 0 0 0 auto; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-toggle-close:hover {
  background: var(--line);
  transform: rotate(90deg);
}
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-toggle-close svg {
  width: 12px; height: 12px;
  fill: currentColor;
}

/* --- Środek: przewija się tylko lista produktów ------------- */

:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-content,
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-content-inner {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}
/* Zapas: gdyby lista nie dostała własnego przewijania,
   przewinie się cały środek — jak dotąd. */
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-content { overflow-x: hidden; overflow-y: auto; }
:is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-content-inner { overflow: visible; }

:is(#woo-cart-panel, .ct-panel) .ww-mc {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--font-body);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc *,
:is(#woo-cart-panel, .ct-panel) .ww-mc *::before,
:is(#woo-cart-panel, .ct-panel) .ww-mc *::after { box-sizing: border-box; }

:is(#woo-cart-panel, .ct-panel) .ww-mc__empty {
  margin: 0;
  padding: 60px 20px;
  text-align: center;
  font-size: 15px; line-height: 1.5;
  color: var(--ink-soft);
}

/* --- Pasek darmowej dostawy --------------------------------- */

:is(#woo-cart-panel, .ct-panel) .ww-mc-ship {
  flex: none;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship__bar {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship__bar i {
  display: block; height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship__txt {
  margin: 8px 0 0;
  font-size: 12.5px; line-height: 1.4;
  color: var(--ink-soft);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship__txt b { color: var(--ink); font-weight: 700; white-space: nowrap; }
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship__txt .amount { font-weight: 700; }
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship.is-unlocked .ww-mc-ship__bar i { background: oklch(0.62 0.15 150); }
:is(#woo-cart-panel, .ct-panel) .ww-mc-ship.is-unlocked .ww-mc-ship__txt b { color: oklch(0.46 0.13 150); }

/* --- Lista produktów ---------------------------------------- */

:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc__list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 12px 24px;
  list-style: none;
  border: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  list-style: none;
  max-height: 260px;
  overflow: hidden;
  transition: opacity .26s ease, transform .26s ease, max-height .26s ease, padding .26s ease;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line::before,
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line::after { display: none; }

/* Usuwana pozycja odjeżdża w prawo i się zwija. */
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line.is-removing {
  opacity: 0;
  transform: translateX(34px);
  max-height: 0;
  padding-top: 0; padding-bottom: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}

:is(#woo-cart-panel, .ct-panel) .ww-mc-line__media {
  flex: none;
  display: block;
  width: 62px; height: 62px;
  margin: 0; padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__media img {
  display: block;
  width: 100% !important; height: 100% !important;
  max-width: none;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}

:is(#woo-cart-panel, .ct-panel) .ww-mc-line__info { flex: 1; min-width: 0; }

:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line__name {
  display: block;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 600; font-size: 14px; line-height: 1.25;
  text-decoration: none;
  text-transform: none;
  color: var(--ink);
  transition: color .18s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc a.ww-mc-line__name:hover { color: var(--accent); }

:is(#woo-cart-panel, .ct-panel) .ww-mc-line__tags {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  margin-top: 5px;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__chip {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px; font-weight: 800; line-height: 1.4;
  letter-spacing: .03em; text-transform: uppercase;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__chip--pack { color: var(--ink); background: color-mix(in oklab, var(--ink) 10%, var(--surface)); }
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__chip--deal { color: #fff; background: var(--accent); }
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__plus { font-size: 11px; font-weight: 800; color: var(--ink-soft); }

:is(#woo-cart-panel, .ct-panel) .ww-mc-line__meta {
  margin-top: 3px;
  font-size: 12.5px; line-height: 1.4;
  color: var(--ink-soft);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__was { text-decoration: line-through; opacity: .7; }
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__now { color: var(--accent); font-weight: 700; }

:is(#woo-cart-panel, .ct-panel) .ww-mc-line__actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
}

/* Licznik − 1 + */
:is(#woo-cart-panel, .ct-panel) .ww-mc-qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-qty button {
  width: 28px; height: 28px; min-height: 0;
  margin: 0; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: 15px; font-weight: 500; line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: background-color .2s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-qty button:hover { background: var(--surface); color: var(--ink); }
:is(#woo-cart-panel, .ct-panel) .ww-mc-qty button.is-max { opacity: .35; cursor: not-allowed; }
:is(#woo-cart-panel, .ct-panel) .ww-mc-qty button.is-max:hover { background: transparent; }
:is(#woo-cart-panel, .ct-panel) .ww-mc-qty__num {
  min-width: 26px;
  text-align: center;
  font-size: 13.5px; font-weight: 600;
}

/* Pozycja ze zdrapki ma stałą ilość. */
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__fixed {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
  font-size: 11px; font-weight: 800; line-height: 1.3;
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent);
}

:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line__remove {
  flex: none;
  width: 28px; height: 28px;
  margin: 0; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .18s, background-color .18s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line__remove svg { width: 16px; height: 16px; }
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-line__remove:hover {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, var(--bg));
}

:is(#woo-cart-panel, .ct-panel) .ww-mc-line__price {
  flex: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  font-weight: 700; font-size: 14px;
  white-space: nowrap;
  color: var(--ink);
  transition: opacity .2s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-line__price-was {
  font-size: 11.5px; font-weight: 600;
  text-decoration: line-through;
  color: var(--ink-soft);
}
/* Czekamy na przeliczenie — stara kwota przygasa. */
:is(#woo-cart-panel, .ct-panel) .ww-mc-line.is-busy .ww-mc-line__price { opacity: .4; }

/* --- Dół: kod rabatowy, suma, "Do kasy" --------------------- */

:is(#woo-cart-panel, .ct-panel) .ww-mc__foot {
  flex: none;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line);
}

:is(#woo-cart-panel, .ct-panel) .ww-mc-promo {
  --pg: oklch(0.62 0.15 150);
  --pg-dark: oklch(0.46 0.13 150);
  margin-bottom: 16px;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo > * + * { margin-top: 8px; }

:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 0;
  margin: 0; padding: 4px 2px;
  border: 0; border-radius: 0;
  background: none;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: 13.5px; font-weight: 700; letter-spacing: .01em; line-height: 1.3;
  text-transform: none;
  color: var(--pg-dark);
  cursor: pointer;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__toggle:hover {
  background: none;
  color: var(--pg-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__toggle svg { width: 16px; height: 16px; flex: none; }
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__toggle[hidden],
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__form[hidden],
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__err[hidden] { display: none; }

:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__form {
  display: flex; align-items: center; gap: 8px;
  height: 46px;
  margin: 0;
  padding: 6px 6px 6px 16px;
  border: 1.6px dashed color-mix(in oklab, var(--pg) 62%, var(--line));
  border-radius: 999px;
  background: color-mix(in oklab, var(--pg) 6%, var(--surface));
  transition: border-color .18s, box-shadow .18s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__form:focus-within {
  border-color: var(--pg);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--pg) 18%, transparent);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__form.is-error {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__input {
  flex: 1; min-width: 0;
  height: 100%; min-height: 0;
  margin: 0; padding: 0;
  border: 0; border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 15px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__input:focus { border: 0; box-shadow: none; outline: none; }
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__input::placeholder {
  font-family: var(--font-body);
  font-weight: 600; letter-spacing: .02em;
  text-transform: none;
  color: var(--ink-soft);
  opacity: 1;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__btn {
  flex: none;
  height: 34px; min-height: 0;
  margin: 0; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: var(--pg);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12.5px; font-weight: 800; letter-spacing: .01em; line-height: 1;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--pg-dark), 0 4px 6px color-mix(in oklab, var(--pg-dark) 55%, transparent);
  transform: translateY(-1px);
  transition: transform .1s ease, box-shadow .1s ease, filter .18s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__btn:hover:not(:disabled) { filter: brightness(1.05); background: var(--pg); color: #fff; }
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--pg-dark), 0 1px 2px color-mix(in oklab, var(--pg-dark) 50%, transparent);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__btn:disabled {
  background: color-mix(in oklab, var(--pg) 38%, var(--line));
  box-shadow: 0 3px 0 color-mix(in oklab, var(--pg-dark) 30%, var(--line));
  color: color-mix(in oklab, #fff 75%, transparent);
  cursor: default;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__form.is-busy .ww-mc-promo__btn { opacity: .6; }

:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__err {
  margin: 8px 0 0;
  font-size: 12px; font-weight: 600; line-height: 1.4;
  color: var(--accent);
}

:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__applied {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px 10px 14px;
  border: 1.6px dashed color-mix(in oklab, var(--pg) 55%, var(--line));
  border-radius: 14px;
  background: color-mix(in oklab, var(--pg) 9%, var(--bg));
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__tick {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pg);
  color: #fff;
  font-size: 12px; font-weight: 800;
  box-shadow: 0 2px 0 var(--pg-dark);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  line-height: 1.25;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__meta b { font-size: 13.5px; letter-spacing: .04em; color: var(--ink); }
:is(#woo-cart-panel, .ct-panel) .ww-mc-promo__meta span { font-size: 12px; color: var(--ink-soft); }
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__clear {
  flex: none;
  width: 26px; height: 26px; min-height: 0;
  margin: 0; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none;
  box-shadow: none;
  font-size: 16px; line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .18s, background-color .18s, transform .2s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc-promo__clear:hover {
  color: var(--ink);
  background: color-mix(in oklab, var(--ink) 9%, transparent);
  transform: rotate(90deg);
}

:is(#woo-cart-panel, .ct-panel) .ww-mc__row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc__row--disc { color: oklch(0.46 0.13 150); font-weight: 700; }

:is(#woo-cart-panel, .ct-panel) .ww-mc__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc__total > span { font-size: 14px; color: var(--ink-soft); }
:is(#woo-cart-panel, .ct-panel) .ww-mc__total b {
  font-family: var(--font-display);
  font-weight: var(--display-weight, 800);
  font-size: 28px; line-height: 1;
  letter-spacing: var(--display-spacing, -0.03em);
  color: var(--ink);
}

/* Krótki komunikat nad sumą (np. "Więcej sztuk nie mamy"). */
:is(#woo-cart-panel, .ct-panel) .ww-mc__flash {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 12%, var(--bg));
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  color: color-mix(in oklab, var(--accent) 80%, var(--ink));
}

:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc__checkout {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px;
  margin: 0; padding: 14px 26px;
  border: 0; border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-body);
  font-weight: 800; font-size: 16px; letter-spacing: .01em; line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc__checkout:hover {
  color: var(--accent-ink);
  transform: translateY(-3px);
  box-shadow: 0 7px 0 rgba(0, 0, 0, .18);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc__checkout:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}

/* Pasek darmowej dostawy z Blocksy: chowamy, gdy jest nasz u góry.
   Gdy naszego nie ma (próg ustawiony poza WooCommerce), zostaje ten
   z Blocksy — ubrany tak samo. */
:is(#woo-cart-panel, .ct-panel) .ww-mc.has-ship .ct-shipping-progress-mini-cart { display: none; }
:is(#woo-cart-panel, .ct-panel) .ww-mc .ct-shipping-progress-mini-cart { margin: 0 0 16px; padding: 0; border: 0; }
:is(#woo-cart-panel, .ct-panel) .ww-mc .ct-shipping-progress-mini-cart .ct-message,
:is(#woo-cart-panel, .ct-panel) .ww-mc .ct-shipping-progress-mini-cart p {
  margin: 0 0 8px;
  font-size: 12.5px; line-height: 1.4;
  color: var(--ink-soft);
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ct-shipping-progress-mini-cart .ct-progress-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
:is(#woo-cart-panel, .ct-panel) .ww-mc .ct-shipping-progress-mini-cart .ct-progress-bar span {
  display: block; height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

/* Niski ekran (telefon bokiem): przewija się cały koszyk,
   żeby na listę produktów zostało miejsce. */
@media (max-height: 600px) {
  :is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-panel-content-inner,
  :is(#woo-cart-panel, .ct-panel) .ww-mc,
  :is(#woo-cart-panel, .ct-panel) .ww-mc .ww-mc__list { flex: none; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  :is(#woo-cart-panel, .ct-panel) .ww-mc *,
  :is(#woo-cart-panel, .ct-panel:has(.ww-mc)) .ct-toggle-close { transition: none !important; }
}
