/* =====================================================================
 * KS-CART-V1 — Stripe-style /koszyk redesign (2026-05-13)
 *
 * Matches the kscheckout module's visual language:
 *   - White cards (border #e2e8f0, shadow-sm, radius 12px)
 *   - Inter / system-ui typography
 *   - Orange (#f97316) primary actions
 *   - 2-column layout on desktop, stacked on mobile
 *   - Sticky right rail on desktop
 *   - Sticky bottom CTA on mobile (already wired in markup)
 *   - Custom qty stepper using PS touchspin +/- buttons
 *
 * Body id is `body#cart`. PS classic markup is kept intact — this file
 * is a pure visual overlay so all add/remove/update JS still works.
 * ===================================================================== */

body#cart {
  background: #f8fafc;
  --ks-primary: #f97316;
  --ks-primary-hover: #ea580c;
  --ks-border: #e2e8f0;
  --ks-border-strong: #cbd5e1;
  --ks-text: #0f172a;
  --ks-text-secondary: #334155;
  --ks-text-muted: #64748b;
  --ks-success: #16a34a;
  --ks-bg-soft: #f8fafc;
  --ks-radius-card: 12px;
  --ks-radius-input: 8px;
  --ks-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ----- Layout shell ----- */
body#cart #content-wrapper {
  background: transparent !important;
}
body#cart #main {
  max-width: 1200px;
  margin: 24px auto 64px;
  padding: 0 16px;
}
body#cart #main .cart-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 0 !important;
}
body#cart .cart-grid-body,
body#cart .cart-grid-right {
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}
body#cart .cart-grid-body { flex: 1 1 580px; min-width: 0; }
body#cart .cart-grid-right { flex: 0 0 360px; }

@media (min-width: 992px) {
  body#cart .cart-grid-right .card.cart-summary,
  body#cart .cart-grid-right .ks-reassurance,
  body#cart .cart-grid-right > .block-reassurance {
    position: sticky;
    top: 88px;
  }
  body#cart .cart-grid-right { align-self: flex-start; }
}

@media (max-width: 991px) {
  body#cart .cart-grid-right { flex: 1 1 100%; }
  /* Kill the PrestaShop default sticky summary on mobile — it overlays the
   * cart items list. Let the summary flow below the items naturally. */
  body#cart .cart-grid-right,
  body#cart .cart-grid-right .card.cart-summary,
  body#cart .cart-grid-right .ks-reassurance,
  body#cart .cart-grid-right > .block-reassurance {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
  }
}

/* ----- Card primitive ----- */
body#cart .card.cart-container,
body#cart .card.cart-summary {
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius-card);
  box-shadow: var(--ks-shadow-card);
  margin-bottom: 24px;
  padding: 24px;
  overflow: hidden;
}
body#cart .card.cart-container .card-block,
body#cart .card.cart-summary .card-block {
  padding: 0;
}
body#cart .card.cart-container hr.separator,
body#cart .card.cart-summary hr {
  border: 0;
  border-top: 1px solid var(--ks-border);
  margin: 16px 0;
}

/* ----- Card title ----- */
body#cart h1.h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--ks-text);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}
body#cart h1.h1::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 24px;
  background: var(--ks-primary);
  border-radius: 3px;
}
body#cart h1.h1::after {
  content: attr(data-count);
}

/* ----- Cart line ----- */
body#cart .cart-overview { margin-top: 8px; }
body#cart .cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
body#cart .cart-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--ks-border);
}
body#cart .cart-item:first-child { padding-top: 0; }
body#cart .cart-item:last-child { border-bottom: 0; padding-bottom: 0; }

body#cart .product-line-grid {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  grid-template-areas: 'image body actions';
  gap: 16px;
  align-items: center;
  margin: 0 !important;
}
body#cart .product-line-grid-left,
body#cart .product-line-grid-body,
body#cart .product-line-grid-right {
  padding: 0 !important;
  width: auto !important;
  float: none !important;
  max-width: none !important;
  flex: none !important;
}
body#cart .product-line-grid-left { grid-area: image; }
body#cart .product-line-grid-body { grid-area: body; min-width: 0; }
body#cart .product-line-grid-right { grid-area: actions; }

body#cart .product-image {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  border: 1px solid var(--ks-border);
  overflow: hidden;
  background: #fff;
}
body#cart .product-image picture,
body#cart .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

body#cart .product-line-info {
  margin: 0;
  padding: 0;
}
body#cart .product-line-info a.label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ks-text);
  line-height: 1.35;
  text-decoration: none;
  display: block;
}
body#cart .product-line-info a.label:hover {
  color: var(--ks-primary);
}

body#cart .product-line-info.product-price {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ks-text-muted);
  font-weight: 500;
}
body#cart .product-line-info.product-price .current-price .price {
  color: var(--ks-text-muted);
  font-weight: 500;
  font-size: 13.5px;
}
body#cart .product-line-info.product-price .product-discount .regular-price {
  text-decoration: line-through;
  color: var(--ks-text-muted);
  font-size: 12.5px;
  margin-right: 6px;
}
body#cart .product-line-info.product-price .discount {
  display: inline-block;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
body#cart .product-line-info.product-price br { display: none; }

/* unit_price_full block kept hidden — not relevant for license keys */
body#cart .unit-price-cart { display: none; }

/* ----- Right column: qty + line total + remove ----- */
body#cart .product-line-grid-right .row {
  display: flex !important;
  align-items: center;
  gap: 16px;
  margin: 0 !important;
}
body#cart .product-line-grid-right .col-xs-4.hidden-md-up { display: none !important; }
body#cart .product-line-grid-right .col-md-10,
body#cart .product-line-grid-right .col-md-6,
body#cart .product-line-grid-right .col-md-2 {
  padding: 0 !important;
  flex: none !important;
  width: auto !important;
  max-width: none !important;
}
body#cart .product-line-grid-right .col-md-10 .row {
  display: flex !important;
  align-items: center;
  gap: 16px;
}
body#cart .product-line-grid-right .qty { order: 1; }
body#cart .product-line-grid-right .price { order: 2; }

/* ----- Quantity stepper: hide native arrows, restyle touchspin +/- ----- */
body#cart .input-group.bootstrap-touchspin {
  display: inline-flex !important;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--ks-border-strong);
  border-radius: var(--ks-radius-input);
  background: #fff;
  overflow: hidden;
  width: auto;
  height: 36px;
}
body#cart .js-cart-line-product-quantity {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 38px !important;
  height: 34px !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--ks-text) !important;
  font-family: inherit !important;
  outline: none !important;
  border-radius: 0 !important;
}
body#cart .js-cart-line-product-quantity::-webkit-inner-spin-button,
body#cart .js-cart-line-product-quantity::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
  display: none !important;
}
body#cart .js-cart-line-product-quantity:focus {
  outline: none !important;
  background: rgba(249, 115, 22, 0.04) !important;
}

body#cart .btn.btn-touchspin.js-touchspin {
  width: 32px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--ks-text-secondary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
body#cart .btn.btn-touchspin.js-touchspin:hover {
  background: rgba(249, 115, 22, 0.08);
  color: var(--ks-primary);
}
body#cart .btn.btn-touchspin.js-touchspin:active {
  background: rgba(249, 115, 22, 0.16);
}
body#cart .btn.btn-touchspin.js-touchspin .material-icons,
body#cart .btn.btn-touchspin.js-touchspin i {
  font-size: 0;            /* hide chevron glyph */
  color: inherit;
  width: 14px;
  height: 14px;
  position: relative;
  display: inline-block;
}
body#cart .js-increase-product-quantity .material-icons::after,
body#cart .js-increase-product-quantity i::after {
  content: '+';
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 14px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
body#cart .js-decrease-product-quantity .material-icons::after,
body#cart .js-decrease-product-quantity i::after {
  content: '−';            /* minus sign U+2212 */
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 14px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
/* Decrease button on the left, increase on the right */
body#cart .input-group.bootstrap-touchspin .input-group-btn-vertical { display: contents; }
body#cart .js-increase-product-quantity { order: 3; border-left: 1px solid var(--ks-border) !important; }
body#cart .js-decrease-product-quantity { order: 1; border-right: 1px solid var(--ks-border) !important; }
body#cart .input-group.bootstrap-touchspin .js-cart-line-product-quantity { order: 2; }

/* ----- Line total ----- */
body#cart .product-price strong,
body#cart .product-line-grid-right .price strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ks-text);
  white-space: nowrap;
}

/* ----- Remove from cart ----- */
body#cart .cart-line-product-actions { display: flex; align-items: center; }
body#cart .remove-from-cart {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--ks-text-muted);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
body#cart .remove-from-cart:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}
body#cart .remove-from-cart .material-icons {
  font-size: 18px;
  float: none !important;
}

/* ----- Continue shopping link ----- */
body#cart a[href].label[href*="index"],
body#cart .cart-grid-body > a.label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ks-text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.15s;
}
body#cart .cart-grid-body > a.label:hover { color: var(--ks-primary); }
body#cart .cart-grid-body > a.label .material-icons { font-size: 18px; }

/* ----- Summary card totals ----- */
body#cart .card.cart-summary .cart-detailed-totals { padding: 0; }
body#cart .card.cart-summary .cart-detailed-subtotals {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body#cart .cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--ks-text-secondary);
  margin: 0 !important;
  line-height: 1.4;
}
body#cart .cart-summary-line .label,
body#cart .cart-summary-line span.label,
body#cart .cart-summary-line .value {
  color: inherit;
  font-weight: 500;
}
body#cart .cart-summary-line .value {
  color: var(--ks-text);
  font-weight: 600;
}
body#cart .cart-summary-line.cart-total {
  border-top: 1px solid var(--ks-border);
  padding-top: 16px !important;
  padding-bottom: 4px !important;
  margin-top: 12px !important;
}
body#cart .cart-summary-line.cart-total .label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ks-text);
}
body#cart .cart-summary-line.cart-total .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ks-text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
body#cart #cart-subtotal-discount {
  color: var(--ks-success);
}
body#cart #cart-subtotal-discount .label,
body#cart #cart-subtotal-discount .value {
  color: var(--ks-success);
  font-weight: 600;
}

body#cart .cart-summary-line.cart-summary-tax-line {
  font-size: 12px;
  color: var(--ks-text-muted);
  padding-top: 0;
  padding-bottom: 0;
}
body#cart .cart-summary-line.cart-summary-tax-line .value { color: var(--ks-text-muted); font-weight: 500; }

/* "Wysyłka — Za darmo!" should pop in green to reinforce the value */
body#cart #cart-subtotal-shipping .value {
  color: var(--ks-success);
  font-weight: 700;
}

/* ----- Primary CTA (Proceed to checkout) ----- */
body#cart .cart-detailed-actions { padding-top: 16px !important; margin-top: 16px; border-top: 1px solid var(--ks-border); }
body#cart .cart-grid-right .cart-detailed-actions a.btn.btn-primary,
body#cart .cart-grid-right .cart-detailed-actions button.btn.btn-primary,
body#cart .cart-detailed-actions a.btn.btn-primary,
body#cart .cart-detailed-actions button.btn.btn-primary {
  display: block !important;
  width: 100% !important;
  background: var(--ks-primary) !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: var(--ks-radius-input) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  padding: 14px 20px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35), 0 2px 4px rgba(234, 88, 12, 0.20) !important;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s !important;
  text-decoration: none !important;
  text-align: center !important;
}
body#cart .cart-grid-right .cart-detailed-actions a.btn.btn-primary:hover,
body#cart .cart-grid-right .cart-detailed-actions button.btn.btn-primary:hover,
body#cart .cart-detailed-actions a.btn.btn-primary:hover,
body#cart .cart-detailed-actions button.btn.btn-primary:hover {
  background: var(--ks-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45) !important;
}
body#cart .cart-detailed-actions .btn.btn-primary:active {
  transform: translateY(0);
}
body#cart .cart-detailed-actions .btn.btn-primary.disabled,
body#cart .cart-detailed-actions button.btn.btn-primary[disabled] {
  background: var(--ks-border-strong) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #fff !important;
  cursor: not-allowed !important;
}

/* ----- CTA trust strip (payments + rating) — tightened ----- */
body#cart .ks-cta-trust {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body#cart .ks-cta-trust-payments {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
body#cart .ks-cta-trust-payments span {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ks-text-muted);
  padding: 3px 6px;
  background: var(--ks-bg-soft);
  border: 1px solid var(--ks-border);
  border-radius: 4px;
  line-height: 1.3;
}
body#cart .ks-cta-trust-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ks-text-secondary);
  flex-wrap: wrap;
}
body#cart .ks-cta-trust-stars { color: #f97316; font-size: 12px; letter-spacing: 1px; }
body#cart .ks-cta-trust-score { font-weight: 700; color: var(--ks-text); }
body#cart .ks-cta-trust-source { color: var(--ks-text-muted); font-size: 11px; }

/* ----- Voucher / coupon block ----- */
body#cart .block-promo {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--ks-border);
}
body#cart .promo-code-button {
  margin: 0;
  padding: 0;
}
body#cart .promo-code-button a.collapse-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 6px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ks-text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
body#cart .promo-code-button a.collapse-button::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ks-bg-soft);
  border: 1px solid var(--ks-border);
  font-size: 14px;
  line-height: 1;
  color: var(--ks-text-muted);
  font-weight: 600;
}
body#cart .promo-code-button a.collapse-button:hover { color: var(--ks-primary); }
body#cart .promo-code-button a.collapse-button:hover::before {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--ks-primary);
  color: var(--ks-primary);
}

body#cart #promo-code { margin-top: 10px; }
body#cart #promo-code .promo-code form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
body#cart .promo-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--ks-border-strong);
  border-radius: var(--ks-radius-input);
  font-size: 14px;
  font-family: inherit;
  color: var(--ks-text);
  background: #fff;
  text-indent: 0 !important;
  text-transform: none !important;
}
body#cart .promo-input::placeholder { color: var(--ks-text-muted); }
body#cart .promo-input:focus {
  outline: none;
  border-color: var(--ks-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}
body#cart #promo-code .promo-code form > button.btn.btn-primary,
body#cart #promo-code .btn.btn-primary {
  height: 40px;
  padding: 0 16px;
  background: var(--ks-text);
  border: 0;
  border-radius: var(--ks-radius-input);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: none;
  transform: none !important;
  white-space: nowrap;
}
body#cart #promo-code .btn.btn-primary:hover { background: #1e293b; }

/* Applied voucher list — green pill with code chip on left, amount + ✕ on right */
body#cart .promo-name {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
body#cart .promo-name .cart-summary-line {
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: var(--ks-radius-input);
  padding: 8px 10px 8px 12px !important;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
body#cart .promo-name .cart-summary-line::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ks-success);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
body#cart .promo-name .cart-summary-line .label {
  color: var(--ks-success);
  font-weight: 600;
  flex: 1;
  margin-left: 8px;
  font-size: 12.5px;
}
body#cart .promo-name .cart-summary-line .float-xs-right {
  display: flex;
  align-items: center;
  gap: 6px;
  float: none !important;
  color: var(--ks-success);
  font-weight: 700;
  font-size: 12.5px;
}
body#cart .promo-name [data-link-action="remove-voucher"] {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--ks-text-muted);
  text-decoration: none;
  margin-left: 0;
  transition: background 0.15s, color 0.15s;
}
body#cart .promo-name [data-link-action="remove-voucher"]:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}
body#cart .promo-name [data-link-action="remove-voucher"] .material-icons { font-size: 14px; }

/* Auto-apply discounts highlight ("Skorzystaj z naszych ofert") */
body#cart .block-promo.promo-highlighted {
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.20);
  border-radius: var(--ks-radius-input);
  padding: 10px 12px;
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ks-text-secondary);
  text-align: center;
}

/* Force coupon form to start COLLAPSED even when PS auto-expands it
 * after applying a voucher. Customer rarely needs to add a second code
 * — they can re-open via the toggle. */
body#cart #promo-code.collapse,
body#cart #promo-code.collapse.in:not(.show) {
  display: none;
}
body#cart #promo-code.show { display: block; }

/* Hide the "Zamknij" link that PS auto-renders inside the form — its
 * toggle button at the top does the same job and looks cleaner. */
body#cart .promo-code-button.cancel-promo { display: none; }
body#cart .js-discount.promo-discounts { list-style: none; padding: 0; margin: 0; }
body#cart .js-discount.promo-discounts .cart-summary-line {
  padding: 4px 0;
  font-size: 13px;
}
body#cart .js-discount .code {
  display: inline-block;
  background: var(--ks-text);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 6px;
}

/* Error alert — hidden by default; PS toggles display via JS when needed.
 * The element ships with a non-empty <span> child so :not(:empty) would
 * always be true — gate on aria-hidden + an explicit visible attr that PS
 * sets on real validation errors. */
body#cart .alert.alert-danger.js-error {
  display: none !important;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.20);
  color: #b91c1c;
  border-radius: var(--ks-radius-input);
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 13px;
}
body#cart .alert.alert-danger.js-error[style*="display: block"],
body#cart .alert.alert-danger.js-error.show {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

/* ----- Sidebar cleanup: kill ALL hook noise, keep ONLY summary + CTA -----
 * The right rail mirrors the kscheckout sidebar — a single tight column:
 *   Podsumowanie title → totals → big "Do zapłaty" → coupon → orange CTA
 *   → small payment strip → tiny TS rating. Nothing else.
 *
 * The first child of .card.cart-summary is the displayShoppingCart hook
 * output (delivery promise + trust badges + coupon hint). All of that
 * lives on the LEFT column now (ks-cart-trust + ks-cart-testimonial),
 * so hide the entire block here. */
body#cart .card.cart-summary > div:first-child {
  display: none !important;
}

/* Loyalty points block — module injects this as a separate sidebar tile.
 * It's noise next to the totals. Move it to the bottom of the sidebar
 * as a tiny line below the CTA, or hide entirely on small spaces. */
body#cart .pshow-cart {
  display: none !important;
}

/* Auto-promo highlight ("Skorzystaj z naszych ofert") — pure noise when
 * the customer already has a voucher applied. */
body#cart .promo-discounts,
body#cart .block-promo.promo-highlighted { display: none !important; }

/* "Podsumowanie" title injected via cart-summary card. Style as the
 * kscheckout sidebar h2. */
body#cart .card.cart-summary::before {
  content: 'Podsumowanie';
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ks-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--ks-border);
}

/* Hide PS hook output that looks broken; let our redesign drive the layout. */
body#cart .cart-summary > .cart-detailed-totals + .cart-detailed-totals { display: none; }

/* ===========================================================
 * LEFT COLUMN: trust strip + reassurance card UNDER product items
 * Rendered by cart.tpl via {include file="_partials/ks-cart-trust.tpl"}
 * (or inline) — styled here regardless of where it gets injected.
 * =========================================================== */
body#cart .ks-cart-trust {
  margin-top: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius-card);
  box-shadow: var(--ks-shadow-card);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 20px;
}
@media (min-width: 768px) {
  body#cart .ks-cart-trust { grid-template-columns: repeat(4, 1fr); }
}
body#cart .ks-cart-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ks-text-secondary);
}
body#cart .ks-cart-trust-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.08);
  color: var(--ks-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
body#cart .ks-cart-trust-item-title {
  font-weight: 600;
  color: var(--ks-text);
  font-size: 13px;
  display: block;
  line-height: 1.2;
}
body#cart .ks-cart-trust-item-sub {
  display: block;
  font-size: 12px;
  color: var(--ks-text-muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* Testimonial / social-proof card under trust strip */
body#cart .ks-cart-testimonial {
  margin-top: 12px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(249, 115, 22, 0.01));
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: var(--ks-radius-card);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
body#cart .ks-cart-testimonial-stars {
  color: var(--ks-primary);
  font-size: 14px;
  letter-spacing: 1px;
  margin-bottom: 4px;
  display: block;
}
body#cart .ks-cart-testimonial-quote {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ks-text);
  font-style: italic;
  margin: 0 0 4px;
}
body#cart .ks-cart-testimonial-author {
  font-size: 12px;
  color: var(--ks-text-muted);
  font-style: normal;
}
body#cart .ks-cart-testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ks-text);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body#cart .ks-cart-testimonial-body { flex: 1; min-width: 0; }

/* ----- displayReassurance (under summary on desktop) ----- */
body#cart .block-reassurance {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius-card);
  box-shadow: var(--ks-shadow-card);
  padding: 12px 16px;
}
body#cart .block-reassurance ul { list-style: none; padding: 0; margin: 0; }
body#cart .block-reassurance li {
  border: 0 !important;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ks-text-secondary);
}
body#cart .block-reassurance li + li {
  border-top: 1px solid var(--ks-border) !important;
}
body#cart .block-reassurance li img,
body#cart .block-reassurance li .h6 + span,
body#cart .block-reassurance li span.h6 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ks-text-secondary);
  margin: 0;
}
body#cart .block-reassurance li img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ----- Empty cart ----- */
body#cart .no-items {
  display: block;
  text-align: center;
  padding: 32px 16px;
  color: var(--ks-text-muted);
  font-size: 14.5px;
}

/* ----- Cross-sell ----- */
body#cart .ks-cart-crosssell.ks-recovery-grid {
  margin-top: 32px !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  max-width: 100% !important;
}
body#cart .ks-cart-crosssell h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ks-text-secondary);
  letter-spacing: 0.01em;
  text-transform: none;
  margin: 0 0 12px;
  grid-column: 1 / -1;
}
body#cart .ks-recovery-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--ks-border);
  border-radius: var(--ks-radius-card);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body#cart .ks-recovery-card:hover {
  border-color: var(--ks-primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
body#cart .ks-recovery-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--ks-bg-soft);
  padding: 4px;
  flex-shrink: 0;
}
body#cart .ks-recovery-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
body#cart .ks-recovery-info strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ks-text);
  line-height: 1.3;
}
body#cart .ks-recovery-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ks-primary);
}

/* ----- "Klucz wyślemy w 1 min" urgency message ----- */
body#cart #main > section section > div[style*="rgba(34,197,94"],
body#cart #main > div[style*="rgba(34,197,94"] {
  background: rgba(22, 163, 74, 0.06) !important;
  border-color: rgba(22, 163, 74, 0.20) !important;
  border-radius: var(--ks-radius-input) !important;
  color: var(--ks-success) !important;
  font-size: 13.5px !important;
  padding: 12px 16px !important;
}

/* ----- Mobile sticky-bottom CTA (markup already in actions.tpl) ----- */
body#cart .ks-cart-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--ks-border);
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 50;
}
body#cart .ks-cart-sticky-total { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
body#cart .ks-cart-sticky-total .ks-label { font-size: 11.5px; color: var(--ks-text-muted); }
body#cart .ks-cart-sticky-total .ks-amount { font-size: 18px; font-weight: 700; color: var(--ks-text); }
body#cart .ks-cart-sticky-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ks-primary);
  color: #fff !important;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--ks-radius-input);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}
body#cart .ks-cart-sticky-btn:hover { background: var(--ks-primary-hover); }
@media (min-width: 769px) { body#cart .ks-cart-sticky-cta { display: none; } }
@media (max-width: 768px) { body#cart { padding-bottom: 80px; } }

/* ----- Loyalty / loyalty hook tile ----- */
body#cart [class*="loyalty"],
body#cart [class*="ksgmpl"] {
  margin-top: 16px;
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.20);
  border-radius: var(--ks-radius-input);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ks-text-secondary);
}

/* ----- Hook fallback (cart-summary-top.tpl with delivery + faktura badges) ----- */
body#cart .ks-cart-summary-top {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(34, 197, 94, 0.02));
  border: 1px solid rgba(22, 163, 74, 0.20);
  border-radius: var(--ks-radius-input);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: #166534;
  font-weight: 500;
}

/* ----- Hide PS chatter that adds visual noise ----- */
body#cart .cart-grid-body > h1.h1::before { content: ''; width: 0; }
body#cart .cart-container hr.separator { display: none; }
body#cart .cart-grid-body > .ks-cart-summary-top { display: none; }

/* ----- Hide breadcrumb on cart for a cleaner Stripe feel ----- */
body#cart .breadcrumb,
body#cart nav.breadcrumb { display: none; }

/* ----- Tighter visual rhythm for small screens ----- */
@media (max-width: 575px) {
  body#cart #main { padding: 0 12px; margin: 16px auto 32px; }
  body#cart .card.cart-container,
  body#cart .card.cart-summary { padding: 16px; border-radius: 10px; }
  body#cart h1.h1 { font-size: 20px; }
  body#cart .product-line-grid { grid-template-columns: 64px 1fr; grid-template-areas: 'image body' 'image actions'; gap: 12px; row-gap: 12px; }
  body#cart .product-line-grid-right { grid-area: actions; }
  body#cart .product-line-grid-right .row { justify-content: space-between; }
  body#cart .product-image { width: 64px; height: 64px; }
  body#cart .input-group.bootstrap-touchspin { height: 34px; }
  body#cart .btn.btn-touchspin.js-touchspin { width: 30px; height: 32px; }
  body#cart .js-cart-line-product-quantity { width: 32px !important; height: 32px !important; }
}
