/* Cart page, matched to cart-sample.html. Scoped under .cr-page so the shared layout stays intact. */
.cr-page {
  --cr-primary: #2563eb;
  --cr-primary-dark: #1d4ed8;
  --cr-primary-light: #dbeafe;
  --cr-gold: #f59e0b;
  --cr-navy: #0f172a;
  --cr-dark: #1f2430;
  --cr-gray: #6b7280;
  --cr-border: #eef0f4;
  width: 100%;
  color: var(--cr-dark);
  text-align: right;
  font-family: "dana", "iransans", Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  padding: 8px 0 40px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  overflow-x: clip;
}

.cr-page *,
.cr-page *::before,
.cr-page *::after { box-sizing: border-box; }

.cr-page h1,
.cr-page h2,
.cr-page h3,
.cr-page p { margin: 0; font-family: inherit; letter-spacing: 0; color: inherit; }

.cr-page a { color: inherit; text-decoration: none; }
.cr-page button,
.cr-page input { font-family: inherit; }

.cr-page button {
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}

.cr-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.cr-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 4px;
  font-size: 12.5px;
  color: var(--cr-gray);
}

.cr-crumb a { color: var(--cr-primary); font-weight: 700; }
.cr-crumb a:hover { color: #d97706; }
.cr-crumb .cr-sep { color: #c0c4cc; }
.cr-crumb .cr-current { color: var(--cr-dark); font-weight: 800; }

.cr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.cr-head h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--cr-navy);
  letter-spacing: -1px;
  position: relative;
  padding-bottom: 12px;
}

.cr-head h1::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cr-primary), var(--cr-gold));
}

.cr-head h1::after {
  content: "";
  position: absolute;
  right: 60px;
  bottom: 0;
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: var(--cr-gold);
  opacity: .5;
}

.cr-count { font-size: 13px; color: var(--cr-gray); font-weight: 700; }
.cr-count strong { color: var(--cr-primary); font-weight: 800; }

.cr-message { margin-bottom: 16px; }
.cr-message .alert {
  border-radius: 14px;
  text-align: right;
  margin-bottom: 0;
}

.cr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.cr-items { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.cr-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--cr-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
  transition: .28s cubic-bezier(.34, 1.56, .64, 1);
}

.cr-item:hover {
  box-shadow: 0 14px 34px rgba(37, 99, 235, .12);
  border-color: rgba(37, 99, 235, .2);
  transform: translateY(-2px);
}

.cr-img {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc, #eef0f4);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.cr-img img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  max-width: none;
}

.cr-img.is-missing img { opacity: 0; }
.cr-img.is-missing::after {
  content: "تصویر محصول";
  position: absolute;
  color: #a0a0b0;
  font-size: 11px;
  font-weight: 700;
}

.cr-info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.cr-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--cr-navy);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  transition: .2s;
}

.cr-item:hover .cr-title { color: var(--cr-primary); }

.cr-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--cr-gray); }
.cr-meta span { display: inline-flex; align-items: center; gap: 4px; }

.cr-stock {
  color: #059669;
  font-weight: 800;
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .25);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
}

.cr-stock.is-out {
  color: #dc2626;
  background: rgba(239, 68, 68, .1);
  border-color: rgba(239, 68, 68, .25);
}

.cr-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.cr-now { font-size: 15px; font-weight: 800; color: var(--cr-navy); }
.cr-now small,
.cr-line small { font-size: 11px; font-weight: 500; color: var(--cr-gray); }
.cr-old { font-size: 11.5px; color: #a0a0b0; text-decoration: line-through; }

.cr-off {
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, .3);
}

.cr-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.cr-qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--cr-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 38px;
}

.cr-qty button {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  color: var(--cr-gray);
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: manipulation;
  transition: .2s;
}

.cr-qty button:hover { background: var(--cr-primary-light); color: var(--cr-primary); }
.cr-qty button:active { background: rgba(37, 99, 235, .2); }
.cr-qty button:disabled,
.cr-qty button.is-max { color: #c5c9d1; cursor: not-allowed; }
.cr-qty button:disabled:hover,
.cr-qty button.is-max:hover { background: transparent; color: #c5c9d1; }

.cr-qty-value {
  min-width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--cr-navy);
  padding: 0 4px;
}

.cr-line { font-size: 16px; font-weight: 800; color: var(--cr-navy); letter-spacing: -.3px; }

.cr-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  background: transparent;
  border: 1.5px solid var(--cr-border);
  color: var(--cr-gray);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: .22s;
}

.cr-remove svg { width: 14px; height: 14px; fill: currentColor; }
.cr-remove:hover { border-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, .06); }

.cr-summary {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--cr-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 14px 40px rgba(37, 99, 235, .08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cr-summary h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--cr-navy);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--cr-border);
  position: relative;
}

.cr-summary h3::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 40px;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cr-primary), var(--cr-gold));
}

.cr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--cr-gray);
  padding: 4px 0;
}

.cr-row strong { color: var(--cr-navy); font-weight: 800; font-size: 14px; }
.cr-row.is-off strong { color: #10b981; }

.cr-row.is-total {
  border-top: 1.5px dashed var(--cr-border);
  margin-top: 6px;
  padding-top: 14px;
  font-size: 14px;
}

.cr-row.is-total strong { font-size: 19px; color: var(--cr-navy); letter-spacing: -.4px; }
.cr-row.is-total strong small { font-size: 11px; font-weight: 500; color: var(--cr-gray); }

.cr-page .cr-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  border-radius: 13px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cr-primary), var(--cr-primary-dark));
  box-shadow: 0 10px 28px rgba(37, 99, 235, .35);
  transition: .3s;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
}

.cr-checkout::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  animation: crShine 3s infinite;
  pointer-events: none;
}

@keyframes crShine {
  0% { left: -150px; }
  100% { left: 120%; }
}

.cr-page .cr-checkout:hover,
.cr-page .cr-checkout:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(37, 99, 235, .5);
  background: linear-gradient(135deg, var(--cr-primary-dark), #1e3a8a);
}

.cr-checkout .cr-arrow { font-size: 16px; transition: .2s; }
.cr-checkout:hover .cr-arrow { transform: translateX(-4px); }

.cr-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #10b981;
  font-weight: 700;
  padding: 8px;
  border-radius: 10px;
  background: rgba(16, 185, 129, .06);
  border: 1px solid rgba(16, 185, 129, .15);
  text-align: center;
}

.cr-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--cr-border);
}

.cr-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--cr-gray);
  line-height: 1.6;
}

.cr-ficon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(245, 158, 11, .08));
  display: grid;
  place-items: center;
  font-size: 15px;
}

.cr-feature strong { color: var(--cr-navy); font-weight: 800; display: block; font-size: 12px; }
.cr-feature span { display: block; font-size: 10.5px; color: var(--cr-gray); }

.cr-empty {
  text-align: center;
  padding: 60px 24px;
  background: #fff;
  border: 1px solid var(--cr-border);
  border-radius: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
}

.cr-empty-icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(245, 158, 11, .08));
  display: grid;
  place-items: center;
  font-size: 48px;
  color: var(--cr-primary);
}

.cr-empty h2 { font-size: 22px; font-weight: 800; color: var(--cr-navy); margin-bottom: 8px; }
.cr-empty p {
  font-size: 13.5px;
  color: var(--cr-gray);
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.cr-page .cr-shop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cr-primary), var(--cr-primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 10px 26px rgba(37, 99, 235, .35);
  transition: .25s;
}

.cr-page .cr-shop:hover,
.cr-page .cr-shop:focus { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 36px rgba(37, 99, 235, .5); }

.cr-page.is-busy .cr-qty button,
.cr-page.is-busy .cr-remove,
.cr-page.is-busy .cr-checkout {
  pointer-events: none;
  opacity: .65;
}

@media (max-width: 980px) {
  .cr-layout { grid-template-columns: 1fr; }
  .cr-summary { position: static; top: auto; }
}

@media (max-width: 640px) {
  .cr-page { padding: 4px 0 28px; }
  .cr-wrap { padding-left: 12px; padding-right: 12px; }
  .cr-head { margin-bottom: 16px; }
  .cr-head h1 { font-size: 20px; }
  .cr-head h1::before { width: 40px; }
  .cr-count { font-size: 12px; }
  .cr-item {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
  }
  .cr-item:hover { transform: none; }
  .cr-img { width: 80px; height: 80px; border-radius: 10px; }
  .cr-title { font-size: 12.5px; }
  .cr-meta { font-size: 10.5px; gap: 6px; }
  .cr-now { font-size: 13px; }
  .cr-old { font-size: 10.5px; }
  .cr-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--cr-border);
    gap: 8px;
  }
  .cr-qty { height: 34px; }
  .cr-qty button { width: 32px; height: 32px; font-size: 14px; }
  .cr-qty-value { min-width: 34px; font-size: 13px; }
  .cr-line { font-size: 14px; }
  .cr-remove { padding: 6px 10px; font-size: 10.5px; }
  .cr-summary { padding: 18px 16px; border-radius: 16px; }
  .cr-summary h3 { font-size: 15px; }
  .cr-row { font-size: 12px; }
  .cr-row.is-total strong { font-size: 17px; }
  .cr-checkout { padding: 13px; font-size: 14px; }
  .cr-empty { padding: 40px 18px; border-radius: 18px; }
  .cr-empty-icon { width: 90px; height: 90px; font-size: 40px; }
  .cr-empty h2 { font-size: 18px; }
  .cr-empty p { font-size: 12.5px; }
}
