/* Koszyk page styles — scoped to #koszyk-main */
#koszyk-main {
  padding-block: var(--space-xl);
}

.koszyk-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.koszyk-header-section {
  width: 100%;
}

.koszyk-header-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.koszyk-header-content h1 {
  margin-block-end: 0;
}

.koszyk-count {
  font-size: var(--text-body-large-size);
  line-height: var(--text-body-large-line-height);
  color: var(--color-graphite);
  margin-block-end: 0;
}

.koszyk-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  width: 100%;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  width: 100%;
}

.cart-item {
  background-color: var(--color-white);
  border: 1px solid var(--color-cream-deep);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.cart-item-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-image);
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xxs);
}

.cart-item-name {
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line-height);
  font-weight: 600;
  margin-block-end: 0;
}

.cart-item-name a {
  color: var(--color-dark-chocolate);
  text-decoration: none;
}

.cart-item-name a:hover {
  color: var(--color-raspberry-red);
}

.cart-item-variant,
.cart-item-unit-price {
  font-size: var(--text-body-small-size);
  line-height: var(--text-body-small-line-height);
  color: var(--color-graphite);
  margin-block-end: 0;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
  min-width: 0;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-cream-deep);
  border-radius: var(--radius-button);
  overflow: hidden;
  width: fit-content;
}

.qty-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-vanilla-cream);
  color: var(--color-dark-chocolate);
  font-size: 1.25rem;
  font-weight: 600;
  transition: background-color var(--transition-fast);
}

.qty-btn:hover {
  background-color: var(--color-pistachio-soft);
}

.qty-input {
  width: 60px;
  height: 44px;
  border: none;
  border-inline: 1px solid var(--color-cream-deep);
  text-align: center;
  padding: 0;
  min-height: 44px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-item-total {
  font-weight: 600;
  color: var(--color-dark-chocolate);
  margin-block-end: 0;
  font-size: var(--text-body-size);
}

.remove-item {
  padding: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--color-raspberry-red);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.remove-item:hover {
  color: var(--color-raspberry-deep);
  text-decoration-color: var(--color-raspberry-red);
}

.empty-cart-section {
  width: 100%;
  text-align: center;
  padding-block: var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.empty-cart-section h2 {
  margin-block-end: 0;
}

.empty-cart-section p {
  max-width: 55ch;
  margin-inline: auto;
  margin-block-end: 0;
}

.koszyk-summary-section {
  width: 100%;
  min-width: 0;
}

.summary-panel {
  background-color: var(--color-vanilla-cream);
  border-radius: var(--radius-panel);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.summary-panel h2 {
  margin-block-end: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  font-size: var(--text-body-size);
  line-height: var(--text-body-line-height);
  color: var(--color-graphite);
}

.summary-row span:first-child {
  min-width: 0;
}

.summary-row span:last-child {
  font-weight: 600;
  color: var(--color-dark-chocolate);
  white-space: nowrap;
}

.summary-total {
  border-top: 1px solid var(--color-cream-deep);
  padding-top: var(--space-sm);
  font-size: var(--text-body-large-size);
  font-weight: 600;
  color: var(--color-dark-chocolate);
}

.summary-total span:last-child {
  font-weight: 700;
}

.btn-block {
  width: 100%;
}

.koszyk-trust-section {
  width: 100%;
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  background-color: var(--color-pistachio-soft);
  border-radius: var(--radius-panel);
  padding: var(--space-lg);
}

.trust-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.trust-item h2 {
  font-size: var(--text-h4-size);
  font-family: var(--font-body);
  font-weight: 600;
  margin-block-end: 0;
}

.trust-item p {
  margin-block-end: 0;
  font-size: var(--text-body-small-size);
  line-height: var(--text-body-small-line-height);
  color: var(--color-graphite);
}

.trust-item a {
  color: var(--color-raspberry-red);
  font-weight: 500;
}

.trust-item a:hover {
  color: var(--color-raspberry-deep);
}

/* Tablet */
@media (min-width: 768px) {
  .koszyk-layout {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }

  .cart-item {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .cart-item-image {
    width: 120px;
    aspect-ratio: 4 / 3;
  }

  .cart-item-actions {
    width: 200px;
    flex-shrink: 0;
    align-items: flex-end;
  }

  .quantity-control {
    align-self: flex-end;
  }

  .cart-item-total {
    text-align: right;
  }

  .trust-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Desktop */
@media (min-width: 1024px) {
  #koszyk-main {
    padding-block: var(--space-2xl);
  }

  .koszyk-layout {
    gap: var(--space-xl);
  }

  .summary-panel {
    position: sticky;
    top: var(--space-lg);
  }
}

/* Mobile refinements */
@media (max-width: 767px) {
  .cart-item-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .cart-item-total {
    flex: 1 1 auto;
  }

  .remove-item {
    flex: 0 0 auto;
  }
}
