/* Cart page */

.cart-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cart-page__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* Cart item */

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

.cart-item__image-wrap {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__image {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.cart-item__name {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cart-item__qty {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.cart-item__price {
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.cart-item__remove {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.cart-item__remove:hover {
  background: rgba(239, 68, 68, 0.12);
}

.cart-item__remove img {
  display: block;
}

/* Order summary */

.cart-summary {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

.cart-summary__title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cart-summary__rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.cart-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.9375rem;
}

.cart-summary__row dt {
  color: var(--text-secondary);
  font-weight: 400;
}

.cart-summary__row dd {
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}

.cart-summary__divider {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0;
}

.cart-summary__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-summary__checkout {
  width: 100%;
  padding: 14px 24px;
  margin-top: 4px;
  text-align: center;
  box-sizing: border-box;
}

.cart_totals {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart_totals .wc-proceed-to-checkout .checkout-button {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* Responsive */

@media (max-width: 1024px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .cart-item {
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 16px;
  }

  .cart-item__image-wrap {
    width: 100px;
    height: 70px;
  }

  .cart-item__name {
    flex: 1 1 calc(100% - 120px);
    min-width: 140px;
  }

  .cart-item__price {
    order: 2;
  }

  .cart-item__remove {
    order: 3;
    margin-left: auto;
  }
}

@media (max-width: 480px) {
  .cart-item__name {
    flex: 1 1 100%;
  }

  .cart-item__price,
  .cart-item__remove {
    order: unset;
  }

  .cart-item {
    justify-content: space-between;
  }
}
