/* Cart Page */

.cart-page {
  min-height: 100vh;
  background: #f3f4f6;
  font-family: "PeydaFaNumWeb", sans-serif;
  direction: rtl;
}

.cart-hero {
  background: linear-gradient(to left, #B8860B, #D4AF37);
  padding: 2rem 0 3rem;
}

.cart-hero__inner,
.cart-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.cart-hero__back,
.cart-empty__btn,
.cart-summary__checkout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.cart-hero__back {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.cart-hero__title {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
}

.cart-hero__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.875rem;
}

.cart-content {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.cart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.cart-main-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1.25rem;
}

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

.cart-panel,
.cart-summary {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.cart-panel {
  padding: 1.25rem;
}

.cart-panel__title,
.cart-summary__title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eef2f7;
  border-radius: 0.875rem;
  background: #fafafa;
}

.cart-item__image {
  width: 78px;
  height: 78px;
  border-radius: 0.75rem;
  object-fit: cover;
  background: #fff;
}

.cart-item__name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.cart-item__name a {
  color: inherit;
  text-decoration: none;
}

.cart-item__meta,
.cart-item__price {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(17, 24, 39, 0.7);
}

.cart-item__price {
  margin-top: 0.4rem;
}

.cart-item__badge {
  display: inline-flex;
  width: fit-content;
  margin: 0.1rem 0 0.45rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #e8f0ff;
  color: #2455b8;
  font-size: 0.78rem;
  font-weight: 700;
}

.cart-item__actions {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  overflow: hidden;
}

.cart-qty__btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: #fff;
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-qty__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cart-qty__value {
  min-width: 36px;
  height: 34px;
  border-right: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-remove {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-summary {
  padding: 1.25rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.cart-summary__row,
.cart-summary__total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.cart-summary__row {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: rgba(17, 24, 39, 0.75);
}

.cart-summary__total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-weight: 700;
  color: #111827;
}

.cart-summary__checkout,
.cart-empty__btn {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.875rem;
  background: #B8860B;
  color: #fff;
  font-weight: 700;
}

.cart-summary__checkout:hover,
.cart-empty__btn:hover {
  background: #8A6A16;
}

.cart-summary__checkout--disabled,
.cart-summary__checkout--disabled:hover {
  background: #9ca3af;
  cursor: not-allowed;
}

.cart-summary__digikala-shortcode {
  width: 100%;
  margin-top: 1rem;
}

.cart-main-column > .cart-summary__digikala-shortcode {
  margin-top: 0;
}

.cart-page-digikala-shortcode-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  inset-inline-start: -9999px !important;
  top: auto !important;
}

.cart-summary__digikala-shortcode:empty {
  display: none;
}

.cart-summary__digikala-shortcode img,
.cart-summary__digikala-shortcode iframe,
.cart-summary__digikala-shortcode button,
.cart-summary__digikala-shortcode a {
  max-width: 100%;
}

.cart-summary__note {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: rgba(17, 24, 39, 0.64);
}

.cart-empty {
  max-width: 520px;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  text-align: center;
}

.cart-empty__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B8860B;
}

.cart-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.cart-empty__text {
  margin: 0;
  color: rgba(17, 24, 39, 0.7);
}

.cart-notice {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}

.cart-notice--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.cart-split-notice {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #fecaca;
  border-radius: 1rem;
  background: #FFFBF0;
  color: #7f1d1d;
}

.cart-split-notice h3 {
  margin: 0 0 0.45rem;
  color: #991b1b;
  font-size: 1rem;
  font-weight: 800;
}

.cart-split-notice p {
  margin: 0;
  color: #7f1d1d;
  font-size: 0.9rem;
  line-height: 1.9;
}

.cart-split-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.cart-split-notice__actions button {
  min-height: 44px;
  border: 0;
  border-radius: 0.8rem;
  background: #B8860B;
  color: #fff;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cart-split-notice__actions button:last-child {
  background: #fff;
  color: #B8860B;
  border: 1px solid #E8D49A;
}

.cart-split-notice__actions button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.spin {
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-left: 0.35rem;
}

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

@media (max-width: 1023px) {
  .cart-summary {
    position: static;
  }
}
