/* ==========================================================================
   Espart — Cart (requires main.css)
   Figma: ۰۶ › ۱۰ · سبد خرید (عادی / همکاری) — دسکتاپ (1440)
   Mobile has no Figma frame for the cart: it follows the system's mobile patterns.
   ========================================================================== */

.cart { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; padding-bottom: 24px; }
.cart__title { font-weight: 700; font-size: 20px; line-height: 32px; color: var(--gray-900); }
.cart__layout { display: flex; flex-direction: column; gap: 16px; }
.cart__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cart__aside { display: flex; flex-direction: column; gap: 16px; }
[data-partner-only][hidden] { display: none !important; }

/* Purchase type */
.buy-type { display: flex; flex-direction: column; gap: 8px; }
.buy-type__label { font-weight: 500; font-size: 13px; line-height: 22px; color: var(--gray-700); }
.buy-type__options { display: flex; flex-direction: column; gap: 8px; }
.buy-opt {
  position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0;
  padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px; background: var(--white); cursor: pointer;
}
.buy-opt:has(input:checked) { border: 2px solid var(--primary); background: var(--primary-50); }
.buy-opt input { position: absolute; opacity: 0; width: 0; height: 0; }

.buy-opt input:checked + .radio { border-color: var(--primary); }
.buy-opt input:checked + .radio::after { transform: none; }
.buy-opt input:focus-visible + .radio { box-shadow: 0 0 0 3px var(--primary-100); }
.buy-opt__title { display: flex; align-items: center; min-height: 44px; font-weight: 400; font-size: 14px; line-height: 24px; color: var(--gray-900); white-space: nowrap; }
.buy-opt__hint { margin-inline-start: auto; font-weight: 500; font-size: 12px; line-height: 20px; color: var(--gray-700); text-align: left; }

/* Cart items */
.citems { border: 1px solid var(--gray-300); border-radius: 12px; overflow: hidden; background: var(--white); }
.citem {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-areas: "img info info" "qty qty price";
  align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--gray-300);
}
.citem:last-child { border-bottom: 0; }
.citem__img { grid-area: img; align-self: start; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 8px; background: var(--gray-200); color: var(--gray-600); }
.citem__img .ic { width: 28px; height: 28px; stroke-width: 1.5; }
.citem__info { grid-area: info; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.citem__name { align-self: stretch; font-weight: 700; font-size: 14px; line-height: 24px; color: var(--gray-900); }
.citem__name a:hover { color: var(--primary); }
.citem__code { font-weight: 400; font-size: 12px; line-height: 20px; color: var(--gray-600); }
.citem__fit { display: flex; align-items: center; gap: 4px; font-weight: 500; font-size: 12px; line-height: 20px; color: var(--success-900); }
.citem__fit .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.citem .stepper { grid-area: qty; justify-self: start; }
.citem__price { grid-area: price; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.citem__amount { font-weight: 900; font-size: 16px; line-height: 26px; color: var(--gray-900); }
.citem__cur { font-weight: 500; font-size: 12px; line-height: 20px; color: var(--gray-700); }

/* Suggestions */
.cart__suggest { display: flex; flex-direction: column; gap: 12px; }
.cart__suggest-head { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.cart__suggest-title { font-weight: 700; font-size: 18px; line-height: 28px; color: var(--gray-900); }
.cart__suggest-row { display: flex; gap: 12px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); padding-block: 4px 12px; }
.cart__suggest-row .pcard { flex: 0 0 150px; }

/* Summary */

/* Partner threshold CTA */
.partner-cta {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-50);
}
.partner-cta__title { font-weight: 700; font-size: 14px; line-height: 24px; color: var(--accent-900); }
.partner-cta__text { font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700); }

/* ==========================================================================
   ≥600 — tablets
   ========================================================================== */
@media (min-width: 600px) {
  .buy-type__options { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px; }
  .citem { grid-template-columns: 88px minmax(0, 1fr) auto auto; grid-template-areas: "img info qty price"; gap: 16px; padding: 16px; }
  .citem__img { width: 88px; height: 88px; align-self: center; }
  .citem__img .ic { width: 36px; height: 36px; }
}

/* ==========================================================================
   ≥1200 — Desktop (design 1440)
   ========================================================================== */
@media (min-width: 1200px) {
  .cart { gap: 20px; padding-top: 24px; padding-bottom: 64px; }
  .cart__title { font-size: 28px; line-height: 42px; }
  .cart__layout { flex-direction: row; align-items: flex-start; gap: 32px; }
  .cart__main { flex: 1 1 auto; }
  .cart__aside { flex: 0 0 360px; }
  .citem { display: flex; align-items: center; gap: 16px; padding: 16px; }
  .citem:last-child { border-bottom: 1px solid var(--gray-300); }
  .citem__info { flex: 1 1 auto; }
  .citem__price { flex: 0 0 150px; }
  .cart__suggest { gap: 16px; }
  .cart__suggest-head { height: 36px; }
  .cart__suggest-row { gap: 16px; margin: 0; padding: 0; overflow: visible; }
  .cart__suggest-row .pcard { flex: 0 0 170px; }
}
