/* ==========================================================
   WSPÓLNY KOSZYK
   Ten plik działa na index.html, catalog.html oraz cart.html.
   ========================================================== */

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

.cart-header-button {
  position: relative;
}

.cart-counter-badge,
.header-counter {
  position: absolute;
  top: -7px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.shop-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.shop-cart-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.shop-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2001;
  width: clamp(360px, 37vw, 520px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  box-shadow: -14px 0 40px rgba(0, 0, 0, 0.14);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.shop-cart-drawer.is-open {
  transform: translateX(0);
}

.shop-cart-close {
  position: absolute;
  top: 17px;
  right: 19px;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #222222;
}

.shop-cart-close:hover,
.shop-cart-close:focus-visible {
  background: #eeeeee;
}

.shop-cart-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.shop-cart-heading {
  flex: 0 0 auto;
  padding: 31px 58px 14px;
  text-align: center;
}

.shop-cart-heading svg {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  fill: none;
  stroke: #111111;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-cart-heading h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.shop-cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 17px 27px 18px;
  scrollbar-width: thin;
}

.shop-cart-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.shop-cart-thumb {
  width: 68px;
  height: 68px;
  border-radius: 6px;
  background: #ababab;
}

.shop-cart-item-info {
  min-width: 0;
}

.shop-cart-item-name {
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.15;
}

.shop-cart-item-description,
.shop-cart-item-quantity {
  margin: 0;
  color: #333333;
  font-size: 9px;
  line-height: 1.35;
}

.shop-cart-item-price {
  display: block;
  margin-top: 9px;
  font-size: 13px;
}

.shop-cart-remove {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111111;
}

.shop-cart-remove:hover,
.shop-cart-remove:focus-visible {
  background: #eeeeee;
}

.shop-cart-remove svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shop-cart-empty {
  padding: 55px 15px;
  color: #555555;
  text-align: center;
  font-size: 12px;
}

.shop-cart-footer {
  flex: 0 0 auto;
  padding: 12px 27px 30px;
  background: #ffffff;
}

.shop-cart-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 14px;
  font-size: 11px;
}

.shop-cart-summary-line strong {
  font-size: 13px;
}

.shop-cart-checkout {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: #d2d2d2;
  color: #111111;
  font-size: 10px;
  text-decoration: none;
}

.shop-cart-checkout:hover,
.shop-cart-checkout:focus-visible {
  background: #c5c5c5;
}

.shop-cart-checkout.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

/* ===== Pełna strona koszyka ===== */

.cart-page-main {
  padding: 34px 0 70px;
}

.cart-page-title {
  margin: 0 0 30px;
  text-align: center;
  font-size: 30px;
}

.cart-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 28px;
}

.cart-page-list {
  display: grid;
  gap: 14px;
}

.cart-page-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 17px;
  border-radius: 9px;
  background: var(--surface);
}

.cart-page-item-thumb {
  width: 116px;
  height: 105px;
  border-radius: 7px;
  background: var(--placeholder);
}

.cart-page-item h2 {
  margin: 0 0 7px;
  text-transform: uppercase;
  font-size: 13px;
}

.cart-page-item p {
  margin: 0 0 13px;
  font-size: 11px;
}

.cart-page-item strong {
  font-size: 17px;
}

.cart-page-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
}

.cart-quantity-button,
.cart-page-remove {
  min-width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: #ffffff;
}

.cart-page-quantity {
  min-width: 27px;
  text-align: center;
  font-size: 12px;
}

.cart-page-remove {
  align-self: center;
  padding: 0 11px;
  color: #111111;
}

.cart-page-summary {
  position: sticky;
  top: 24px;
  padding: 24px;
  border-radius: 9px;
  background: var(--surface);
}

.cart-page-summary h2 {
  margin: 0 0 24px;
  font-size: 22px;
}

.cart-page-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  font-size: 12px;
}

.cart-page-summary-total {
  padding-top: 16px;
  border-top: 1px solid #c2c2c2;
  font-weight: 700;
}

.cart-page-order {
  width: 100%;
  height: 40px;
  margin-top: 16px;
  border: 0;
  border-radius: 7px;
  background: #cfcfcf;
}

.cart-page-empty {
  padding: 65px 25px;
  border-radius: 9px;
  background: var(--surface);
  text-align: center;
}

.cart-page-empty h2 {
  margin: 0 0 10px;
}

.cart-page-empty p {
  margin: 0 0 22px;
  color: var(--muted-text);
}

.cart-page-empty a {
  display: inline-flex;
  min-width: 180px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--surface-medium);
}

.cart-page-feedback {
  min-height: 17px;
  margin: 14px 0 0;
  color: #444444;
  text-align: center;
  font-size: 11px;
}

@media (max-width: 800px) {
  .shop-cart-drawer {
    width: min(430px, 100%);
  }

  .cart-page-layout {
    grid-template-columns: 1fr;
  }

  .cart-page-summary {
    position: static;
  }
}

@media (max-width: 520px) {
  .shop-cart-drawer {
    width: 100%;
    min-width: 0;
  }

  .shop-cart-heading {
    padding-top: 25px;
  }

  .shop-cart-items {
    padding-inline: 18px;
  }

  .shop-cart-footer {
    padding-inline: 18px;
  }

  .shop-cart-item {
    grid-template-columns: 62px minmax(0, 1fr) 28px;
  }

  .shop-cart-thumb {
    width: 62px;
    height: 62px;
  }

  .cart-page-main {
    padding-top: 25px;
  }

  .cart-page-item {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
  }

  .cart-page-item-thumb {
    width: 82px;
    height: 82px;
  }

  .cart-page-remove {
    grid-column: 1 / -1;
    justify-self: end;
  }
}


/* Linki ikon w nagłówku zachowują dokładnie ten sam rozmiar co przyciski. */
.header-actions .icon-button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
}
