/* checkout.css — همه‌ی کلاس‌ها با پیشوند ck- تا با CSS اصلی سایت تداخل نکنند */

.ck {
  --ck-ink: #34252d;
  --ck-muted: #8c7a83;
  --ck-line: #f0dde6;
  --ck-blush: #fdf3f8;
  --ck-rose: #E8A1BC;
  --ck-action: #C2427F;
  --ck-action-hover: #a8346b;
  color: var(--ck-ink);
  padding: 24px 0 128px;
}
@media (min-width: 992px) { .ck { padding: 48px 0 72px; } }

/* ---------- Header + steps ---------- */
.ck-head { margin-bottom: 28px; }
.ck-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 16px; }
@media (min-width: 992px) { .ck-title { font-size: 1.85rem; } }

.ck-steps {
  display: flex; align-items: center; list-style: none;
  padding: 0; margin: 0; font-size: .85rem; color: var(--ck-muted);
}
.ck-steps li { display: flex; align-items: center; gap: 8px; }
.ck-steps li:not(:last-child)::after {
  content: ""; width: 28px; height: 1px; background: var(--ck-line); margin-inline: 12px;
}
.ck-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: .75rem; border: 1px solid var(--ck-line); background: #fff;
}
.ck-steps .is-done .ck-dot { background: var(--ck-rose); border-color: var(--ck-rose); color: #fff; }
.ck-steps .is-current { color: var(--ck-ink); font-weight: 600; }
.ck-steps .is-current .ck-dot { background: var(--ck-action); border-color: var(--ck-action); color: #fff; }
@media (max-width: 575.98px) {
  .ck-steps li:not(.is-current) .ck-label { display: none; }
  .ck-steps li:not(:last-child)::after { width: 16px; margin-inline: 8px; }
}

/* ---------- Form sections ---------- */
.ck-section { padding-block: 28px; border-top: 1px solid var(--ck-line); }
.ck-section:first-of-type { border-top: 0; padding-top: 0; }
.ck-h { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; font-weight: 700; margin: 0 0 20px; }
.ck-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: .85rem; font-weight: 600; background: var(--ck-blush); color: var(--ck-action);
  border: 1px solid var(--ck-rose);
}

.ck .form-label, .ck label.requiredField { font-size: .88rem; color: var(--ck-muted); margin-bottom: 6px; }
.ck .form-control, .ck .form-select {
  min-height: 50px; padding-inline: 16px; background-color: #fff;
  border: 1px solid var(--ck-line); border-radius: 14px; color: var(--ck-ink);
  transition: border-color .2s, box-shadow .2s;
}
.ck textarea.form-control { padding-block: 12px; }
.ck .form-control:focus, .ck .form-select:focus {
  border-color: var(--ck-rose); box-shadow: 0 0 0 4px rgba(232, 161, 188, .28); outline: 0;
}
.ck .form-check-input:checked { background-color: var(--ck-action); border-color: var(--ck-action); }
.ck .form-check-input:focus { box-shadow: 0 0 0 4px rgba(232, 161, 188, .28); border-color: var(--ck-rose); }
.ck-check { margin-block: 4px 16px; }
.ck .invalid-feedback, .ck .text-danger, .ck-error { font-size: .85rem; color: #c0392b; }
.ck .asteriskField { color: var(--ck-action); }

.ck-alert {
  background: #fff4f4; border: 1px solid #f3c6c6; color: #a13030;
  border-radius: 14px; padding: 12px 16px; margin-bottom: 20px; font-size: .9rem;
}
.ck-alert ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Payment options ---------- */
.ck-pay { display: grid; gap: 12px; }
.ck-pay-option {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--ck-line); border-radius: 16px;
  background: #fff; cursor: pointer; transition: border-color .2s, background .2s;
}
.ck-pay-option:hover { border-color: var(--ck-rose); }
.ck-pay-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ck-pay-mark {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--ck-rose); background: #fff; position: relative;
}
.ck-pay-mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--ck-action); transform: scale(0); transition: transform .18s;
}
.ck-pay-option:has(input:checked) { border-color: var(--ck-action); background: var(--ck-blush); }
.ck-pay-option:has(input:checked) .ck-pay-mark::after { transform: scale(1); }
.ck-pay-option:has(input:focus-visible) { outline: 3px solid rgba(232, 161, 188, .6); outline-offset: 2px; }
.ck-pay-label { font-weight: 600; }
.ck-note { margin: 14px 0 0; font-size: .85rem; color: var(--ck-muted); }

/* ---------- Buttons ---------- */
.ck-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 36px; border: 0; border-radius: 999px;
  background: var(--ck-action); color: #fff; font-size: 1rem; font-weight: 600;
  transition: background .2s;
}
.ck-btn:hover { background: var(--ck-action-hover); }
.ck-btn:focus-visible { outline: 3px solid rgba(232, 161, 188, .7); outline-offset: 3px; }
.ck-actions { display: flex; align-items: center; gap: 24px; margin-top: 8px; }
.ck-actions .ck-btn { min-width: 260px; }
.ck-back { color: var(--ck-muted); font-size: .9rem; text-decoration: none; }
.ck-back:hover { color: var(--ck-action); text-decoration: underline; }
@media (max-width: 991.98px) {
  .ck-actions .ck-btn { display: none; }
  .ck-actions { justify-content: center; }
}

/* ---------- Order summary ---------- */
.ck-summary {
  background: var(--ck-blush); border: 1px solid var(--ck-line);
  border-radius: 24px; padding: 4px 20px;
}
@media (min-width: 992px) {
  .ck-summary { position: sticky; top: 96px; padding: 12px 28px 8px; }
}
.ck-summary-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; font-weight: 700; cursor: pointer; list-style: none;
}
.ck-summary-toggle::-webkit-details-marker { display: none; }
.ck-sum-end { display: flex; align-items: center; gap: 12px; }
.ck-sum-total { font-weight: 700; color: var(--ck-action); }
.ck-chev {
  width: 8px; height: 8px; border-inline-end: 2px solid var(--ck-muted);
  border-bottom: 2px solid var(--ck-muted); transform: rotate(45deg); margin-top: -4px; transition: transform .2s;
}
details[open] .ck-chev { transform: rotate(225deg); margin-top: 4px; }
@media (min-width: 992px) {
  .ck-summary-toggle { cursor: default; font-size: 1.1rem; }
  .ck-chev, .ck-sum-total { display: none; }
}

.ck-lines { list-style: none; margin: 0; padding: 4px 0 8px; }
.ck-line { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--ck-line); }
.ck-thumb {
  position: relative; flex: 0 0 60px; width: 60px; height: 76px; border-radius: 12px;
  background: #fff; border: 1px solid var(--ck-line);
}
.ck-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.ck-qty {
  position: absolute; top: -8px; inset-inline-start: -8px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: var(--ck-ink); color: #fff; font-size: .72rem;
  display: grid; place-items: center;
}
.ck-line-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ck-line-name { font-weight: 600; font-size: .92rem; line-height: 1.6; }
.ck-line-variant { font-size: .8rem; color: var(--ck-muted); }
.ck-line-price { font-size: .88rem; white-space: nowrap; }

.ck-totals { margin: 0; padding: 8px 0 16px; border-top: 1px solid var(--ck-line); }
.ck-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .92rem; }
.ck-row dt { font-weight: 400; color: var(--ck-muted); }
.ck-row dd { margin: 0; }
.ck-discount dd { color: var(--ck-action); }
.ck-grand { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--ck-line); font-size: 1.05rem; }
.ck-grand dt { color: var(--ck-ink); font-weight: 700; }
.ck-grand dd { font-weight: 700; color: var(--ck-action); }

/* ---------- Mobile sticky pay bar ---------- */
.ck-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 1040;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--ck-line);
}
.ck-bar-total { display: flex; flex-direction: column; line-height: 1.5; }
.ck-bar-total small { font-size: .75rem; color: var(--ck-muted); }
.ck-bar-total strong { font-size: .95rem; color: var(--ck-ink); }
.ck-bar .ck-btn { flex: 1; padding: 0 16px; min-height: 50px; }
@media (min-width: 992px) { .ck-bar { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .ck *, .ck-bar * { transition: none !important; }
}
