.cart-page {
  min-height: 70vh;
  padding: 44px 24px 90px;
  background: var(--bg-soft);
  color: var(--text);
}

.cart-page__container {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.cart-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.cart-header span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.cart-header h1 {
  margin: 7px 0 4px;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -.04em;
}

.cart-header p {
  margin: 0;
  color: var(--text);
}

.cart-clear {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(183, 32, 32, .15);
  border-radius: 10px;
  background: #fff;
  color: #b42323;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
}

.cart-clear svg {
  width: 17px;
  height: 17px;
}

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

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 160px 150px 34px;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 16px;
  background: #fff;
}

.cart-item.is-unavailable {
  opacity: .68;
}

.cart-item__image {
  width: 108px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cart-item__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.cart-item__info small {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.cart-item__info > a {
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
  text-decoration: none;
}

.cart-item__stock {
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
}

.cart-item__warning {
  color: #b42323;
  font-size: 11px;
  font-weight: 850;
}

.cart-item__quantity {
  display: grid;
  grid-template-columns: 38px 62px 38px;
  gap: 4px;
}

.cart-item__quantity button,
.cart-item__quantity input {
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--primary) 13%, transparent);
  border-radius: 8px;
  background: #fff;
}

.cart-item__quantity button {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-item__quantity button svg {
  width: 15px;
  height: 15px;
}

.cart-item__quantity input {
  width: 100%;
  text-align: center;
  font-weight: 800;
  color: var(--text);
}

.cart-item__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.cart-item__price span {
  color: var(--text);
  font-size: 11px;
}

.cart-item__price strong {
  font-size: 17px;
  color: var(--primary);
}

.cart-item__remove {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9b4b4b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-item__remove:hover {
  background: rgba(180, 35, 35, .07);
}

.cart-item__remove svg {
  width: 17px;
  height: 17px;
}

.cart-summary {
  position: sticky;
  top: 92px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 18px;
  background: #fff;
}

.cart-summary > span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.cart-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--text);
}

.cart-summary__total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.cart-summary__total span {
  font-weight: 800;
}

.cart-summary__total strong {
  color: var(--primary);
  font-size: 24px;
}

.cart-checkout {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
  cursor: pointer;
}

.cart-checkout svg {
  width: 17px;
  height: 17px;
}

.cart-continue {
  min-height: 42px;
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.cart-empty,
.cart-loading {
  min-height: 48vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cart-empty svg {
  width: 54px;
  height: 54px;
  color: var(--text-soft);
}

.cart-empty h2 {
  margin: 18px 0 5px;
  font-size: 25px;
}

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

.cart-empty a {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 850;
}

.cart-loading {
  gap: 10px;
  color: var(--text);
}

.cart-loading svg {
  animation: cartSpin .8s linear infinite;
}

@keyframes cartSpin {
  to {
    transform: rotate(360deg);
  }
}

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

  .cart-summary {
    position: static;
  }
}

@media (max-width: 760px) {
  .cart-page {
    padding: 28px 14px 70px;
  }

  .cart-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cart-item {
    grid-template-columns: 84px 1fr;
  }

  .cart-item__image {
    width: 84px;
    height: 80px;
  }

  .cart-item__quantity,
  .cart-item__price {
    grid-column: 2;
  }

  .cart-item__price {
    align-items: flex-start;
  }

  .cart-item__remove {
    position: absolute;
    top: 12px;
    right: 12px;
  }
}
