/* ==========================================================
   CART PAGE
========================================================== */

.cart-page {
  padding-bottom: 70px;
}

.cart-hero {
  padding: 46px 0 28px;
}

.cart-hero__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;

  padding: 46px;
  border: 1px solid rgba(46, 47, 121, 0.11);
  border-radius: 30px;

  background:
    radial-gradient(circle at top right, rgba(77, 83, 159, 0.18), transparent 34%),
    linear-gradient(135deg, #fafbff, #eef1fb);

  box-shadow: 0 24px 64px rgba(31, 25, 84, 0.10);
}

.cart-hero__eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 14px;

  border-radius: 999px;
  background: rgba(46, 47, 121, 0.09);
  color: var(--primary);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cart-hero h1 {
  margin: 0 0 14px;
  color: var(--primary-dark);

  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.cart-hero p {
  max-width: 680px;
  margin: 0;

  color: #687086;
  font-size: 17px;
  line-height: 1.75;
}

.cart-section {
  padding: 34px 0 0;
}

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

/* ITEMS */

.cart-items-card,
.cart-summary,
.cart-empty,
.cart-loading {
  border: 1px solid rgba(46, 47, 121, 0.10);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 20px 54px rgba(31, 25, 84, 0.08);
}

.cart-items-card {
  overflow: hidden;
}

.cart-items-card__head {
  padding: 24px 26px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  border-bottom: 1px solid var(--border-soft);
}

.cart-items-card__head span,
.cart-summary__head span {
  display: block;
  margin-bottom: 5px;

  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cart-items-card__head h2,
.cart-summary__head h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 28px;
  line-height: 1.1;
}

.cart-clear-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: #a33a3a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.cart-clear-btn:hover {
  text-decoration: underline;
}

.cart-items {
  padding: 0 26px;
}

.cart-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;

  padding: 24px 0;
  border-bottom: 1px solid rgba(46, 47, 121, 0.09);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item__media {
  width: 110px;
  height: 110px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border: 1px solid rgba(46, 47, 121, 0.10);
  border-radius: 20px;

  background:
    radial-gradient(circle at top right, rgba(77, 83, 159, 0.14), transparent 38%),
    #f6f7fb;
}

.cart-item__media img {
  width: 100%;
  height: 100%;
  padding: 12px;
  display: block;
  object-fit: contain;
}

.cart-item__placeholder {
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.cart-item__content {
  min-width: 0;
}

.cart-item__main h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.3;
}

.cart-item__main h3 a {
  color: var(--primary-dark);
  text-decoration: none;
}

.cart-item__main h3 a:hover {
  color: var(--primary);
}

.cart-item__unit-price {
  display: block;
  margin-bottom: 16px;
  color: #747a8d;
  font-size: 13px;
  font-weight: 700;
}

.cart-item__controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cart-quantity {
  display: inline-grid;
  grid-template-columns: 38px 50px 38px;
  align-items: center;

  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.cart-quantity__btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: #f7f8fc;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.cart-quantity__btn:hover {
  background: var(--accent-soft);
}

.cart-quantity input {
  width: 50px;
  height: 38px;
  border: 0;
  outline: none;
  text-align: center;
  color: var(--text-main);
  font: inherit;
  font-weight: 900;
  appearance: textfield;
}

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

.cart-item__remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: #a33a3a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.cart-item__remove:hover {
  text-decoration: underline;
}

.cart-item__total {
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

/* SUMMARY */

.cart-summary {
  position: sticky;
  top: 180px;
  padding: 26px;
}

.cart-summary__head {
  margin-bottom: 22px;
}

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

.cart-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  color: #6b7185;
  font-size: 14px;
}

.cart-summary__row strong {
  color: var(--text-main);
  font-size: 14px;
}

.cart-summary__total {
  margin-top: 22px;
  padding-top: 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  border-top: 1px solid var(--border-soft);
}

.cart-summary__total span {
  color: var(--text-main);
  font-weight: 800;
}

.cart-summary__total strong {
  color: var(--primary-dark);
  font-size: 28px;
  letter-spacing: -0.03em;
}

.cart-checkout-btn {
  width: 100%;
  margin-top: 22px;
}

.cart-summary__note {
  margin: 14px 0 0;
  color: #85899b;
  font-size: 12px;
  line-height: 1.55;
}

/* EMPTY / LOADING */

.cart-empty,
.cart-loading {
  grid-column: 1 / -1;
  padding: 70px 28px;
  text-align: center;
}

.cart-empty__icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 28px;
  background: var(--accent-soft);
  color: var(--primary);
}

.cart-empty__eyebrow {
  display: block;
  margin-bottom: 10px;

  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cart-empty h2 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 32px;
}

.cart-empty p,
.cart-loading {
  color: #747a8d;
  line-height: 1.7;
}

.cart-empty .btn {
  margin-top: 24px;
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .cart-hero__inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 34px 26px;
  }

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

  .cart-summary {
    position: static;
  }
}

@media (max-width: 680px) {
  .cart-hero {
    padding-top: 26px;
  }

  .cart-hero__inner {
    padding: 28px 20px;
    border-radius: 24px;
  }

  .cart-items-card__head {
    align-items: flex-start;
    padding: 22px 20px;
  }

  .cart-items {
    padding: 0 20px;
  }

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

  .cart-item__media {
    width: 82px;
    height: 82px;
  }

  .cart-item__total {
    grid-column: 2;
    margin-top: 4px;
  }

  .cart-item__controls {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .cart-summary {
    padding: 22px 20px;
  }
}