/* Wysuwany koszyk — według koncepcji Koszyk / KoszykTelefon / KoszykPusty. */

.xs-drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(20, 20, 21, 0.36);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.xs-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 71;
  width: 460px;
  max-width: calc(100% - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: 28px;
  background: var(--xs-surface);
  box-shadow: 0 24px 60px rgba(20, 20, 21, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateX(32px);
  transition: opacity 0.2s ease, transform 0.25s ease, visibility 0.25s;
}

body.xs-cart-open {
  overflow: hidden;
}

body.xs-cart-open .xs-drawer__backdrop,
body.xs-cart-open .xs-drawer {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.xs-drawer__handle {
  display: none;
}

.xs-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.xs-drawer__head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xs-drawer__close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--xs-radius);
  background: var(--xs-bg);
}

.xs-drawer__added {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--xs-mint);
  font-size: 14px;
  font-weight: 600;
}

.xs-drawer__added[hidden] {
  display: none;
}

.xs-drawer__added svg {
  flex: none;
}

.xs-drawer__body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Produkty ---------- */
.xs-drawer__items {
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.xs-drawer__item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--xs-line-soft);
  transition: opacity 0.15s ease;
}

.xs-drawer__item.is-updating {
  opacity: 0.5;
  pointer-events: none;
}

.xs-drawer__image,
.xs-drawer__suggest-image {
  position: relative;
  flex: none;
  border: 1px solid var(--xs-line-soft);
  border-radius: 14px;
}

.xs-drawer__image {
  width: 84px;
  height: 96px;
}

.xs-drawer__image img,
.xs-drawer__suggest-image img {
  position: absolute;
  top: 6%;
  left: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.xs-drawer__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xs-drawer__name {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.xs-drawer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.xs-drawer__qty {
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--xs-line);
  border-radius: var(--xs-radius);
  background: var(--xs-bg);
}

.xs-drawer__qty button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 18px;
}

.xs-drawer__qty button:disabled {
  color: var(--xs-faint);
  cursor: default;
}

.xs-drawer__qty span {
  min-width: 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.xs-drawer__price {
  font-size: 17px;
  font-weight: 800;
}

/* ---------- Suma i przyciski ---------- */
.xs-drawer__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
}

.xs-drawer__total strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Wysokość i zaokrąglenie jak przycisk InPost Pay pod spodem (48 px, 8 px — tego w ich przycisku nie da się zmienić). */
.xs-drawer__checkout {
  min-height: 48px;
  height: 48px;
  border-radius: 8px;
  font-size: 17px;
}

.xs-drawer__continue {
  border-color: var(--xs-line);
  font-weight: 600;
}

/*
 * „Przejdź do kasy”, pod nim „lub” i „Kup z InPost” (wtyczka, wariant grafitowy, zaokrąglony, size-xl) —
 * jeden pod drugim na całą szerokość (decyzja usera 15.10.2026: w 1/3 wiersza przycisk InPost był ściśnięty).
 * Bez przycisku InPost nie ma też „lub”.
 */
.xs-drawer__buy-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.xs-drawer__or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--xs-muted);
  font-size: 12px;
}

.xs-drawer__or::before,
.xs-drawer__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--xs-line);
}

.xs-drawer__buy-row:not(:has(.izi-widget-placeholder:not(:empty))) .xs-drawer__or,
.xs-drawer .izi-widget-placeholder:empty {
  display: none;
}

.xs-drawer__buy-row .izi-widget-placeholder,
.xs-drawer__buy-row .izi-widget-placeholder > *,
.xs-drawer__buy-row inpost-izi-button {
  display: block;
  width: 100%;
  margin: 0;
}

/* Przycisk w widżecie InPost ma 2 px wcięcia z lewej — bez tego stoi krzywo pod „Przejdź do kasy”. */
.xs-drawer__buy-row .izi-widget-placeholder inpost-izi-button {
  margin-left: -2px;
}
