.cart-page,
.cart-page * {
  box-sizing: border-box;
}

.cart-page {
  padding: 48px 60px 80px;
  font-family: var(--font-main);
  color: var(--text-dark);
  background: #ffffff;
  overflow-x: hidden;
  min-height: calc(100vh - 88px);
}

.cart-page__shell {
  max-width: 1280px;
  margin: 0 auto;
}

.cart-page__hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.cart-page__eyebrow {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.cart-page__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}

.cart-page__count {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dark);
}

.cart-page__count[hidden] {
  display: none;
}

.cart-page__back {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.cart-page__back:hover {
  color: var(--text-dark);
}

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

.cart-page__layout.is-empty {
  grid-template-columns: 1fr;
}

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

.cart-page__layout.is-empty .cart-page__table-head {
  display: none;
}

.cart-page__table-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px 44px;
  gap: 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid #ececec;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.cart-page__table-head span:first-child {
  padding-left: 100px;
}

.cart-page__list .cart-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 200px 44px;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 20px 0;
  border: none;
  border-bottom: 1px solid #ececec;
  border-radius: 0;
  background: transparent;
}

.cart-page__list .cart-item__media {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f5f3;
  border-radius: 16px;
  overflow: hidden;
}

.cart-page__list .cart-item__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.cart-page__list .cart-item__name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cart-page__list .cart-item__code {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.cart-page__list .cart-item__qty {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.cart-page__list .cart-item__qty-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}

.cart-item__stepper {
  display: grid;
  grid-template-columns: 38px minmax(64px, 1fr) 38px;
  align-items: center;
  width: 100%;
  max-width: 200px;
  height: 44px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #ffffff;
}

.cart-page__list .cart-item__minus,
.cart-page__list .cart-item__plus {
  width: 38px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.cart-item__qty-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  outline: none;
}

.cart-page__list .cart-item__remove {
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text-dark);
}

.cart-page__list .cart-item__remove span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cart-page__list .cart-item__remove:hover {
  color: #c45c4a;
  border-color: #c45c4a;
}

.cart-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  text-align: center;
  color: var(--text-muted);
  gap: 10px;
}

.cart-page__empty[hidden] {
  display: none;
}

.cart-page__empty-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #f3f3f3;
  color: var(--text-dark);
}

.cart-page__empty-icon svg {
  width: 32px;
  height: 32px;
}

.cart-page__empty p {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.cart-page__browse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  height: 48px;
  margin-top: 10px;
  padding: 0 22px;
  border: 1px solid #1b1b1b;
  border-radius: 12px;
  background: #ffffff;
  color: #1b1b1b;
  font-size: 14px;
  font-weight: 600;
}

.cart-page__browse:hover {
  background: #1b1b1b;
  color: #ffffff;
}

.cart-page__summary {
  position: sticky;
  top: 108px;
  background: #ffffff;
  border: 1px solid #ececec;
  border-radius: 20px;
  padding: 24px;
}

.cart-page__summary[hidden] {
  display: none;
}

.cart-page__summary-title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
}

.cart-page__stats {
  margin: 0 0 16px;
}

.cart-page__stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #ececec;
}

.cart-page__stats dt {
  font-size: 14px;
  color: var(--text-muted);
}

.cart-page__stats dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.cart-page__hint {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cart-page__quote {
  width: 100%;
  height: 52px;
  border: 1px solid #1b1b1b;
  border-radius: 12px;
  background: #1b1b1b;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.cart-page__quote:hover:not(:disabled) {
  opacity: 0.9;
}

.cart-page__quote:disabled {
  opacity: 0.4;
  cursor: default;
}

.cart-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

.cart-pagination[hidden] {
  display: none;
}

.cart-pagination__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.cart-pagination__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.cart-pagination__btn svg {
  width: 16px;
  height: 16px;
}

.cart-pagination__pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.cart-pagination__pages button {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
}

.cart-pagination__pages button.is-active {
  background: #ececec;
  border-radius: 999px;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .cart-page {
    padding: 36px 32px 64px;
  }

  .cart-page__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .cart-page__summary {
    position: static;
  }

  .cart-page__table-head {
    display: none;
  }

  .cart-page__list .cart-item {
    grid-template-columns: 84px minmax(0, 1fr) 44px;
    grid-template-areas:
      "image info remove"
      "qty qty qty";
  }

  .cart-page__list .cart-item__media {
    grid-area: image;
  }

  .cart-page__list .cart-item__info {
    grid-area: info;
  }

  .cart-page__list .cart-item__qty {
    grid-area: qty;
    max-width: 200px;
    margin-top: 4px;
  }

  .cart-page__list .cart-item__remove {
    grid-area: remove;
  }
}

@media (max-width: 768px) {
  .cart-page {
    padding: 28px 20px 56px;
  }

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

  .cart-page__title {
    font-size: 28px;
  }

  .cart-page__list .cart-item {
    grid-template-columns: 72px minmax(0, 1fr) 40px;
    gap: 12px;
    padding: 16px 0;
  }

  .cart-page__list .cart-item__media {
    width: 72px;
    height: 72px;
  }

  .cart-item__stepper {
    max-width: none;
  }

  .cart-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}
