/* ============================================================
   iStore — checkout.css  (оформление заказа)
   Зависит от переменных theme.css.
   ============================================================ */

.ck-crumb { width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px 24px 0; font-size: 12px; color: var(--muted); }
.ck-crumb a { color: inherit; text-decoration: none; }
.ck-crumb a:hover { color: var(--text); }
.ck-crumb .sep { padding: 0 6px; }
.ck-crumb .cur { color: var(--text); }

.ck-head { width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px 24px 4px; font-size: clamp(26px,3vw,36px); font-weight: 700; letter-spacing: -0.02em; }

.ck-layout {
    width: 100%; max-width: 1280px; margin: 0 auto; padding: 16px 24px 72px;
    display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start;
}

.ck-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ck-side { display: flex; flex-direction: column; gap: 20px; }

.ck-card {
    background: var(--surface); border-radius: 20px; padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ck-card__title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* ---------- товары ---------- */
.ck-items { display: flex; flex-direction: column; }
.ck-item {
    display: grid; grid-template-columns: 64px 1fr auto auto auto; gap: 16px; align-items: center;
    padding: 18px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
}
.ck-item:last-child { border-bottom: 0; }
.ck-item__photo { width: 64px; height: 64px; border-radius: 14px; background: var(--surface-alt); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ck-item__photo img { width: 100%; height: 100%; object-fit: contain; }
.ck-item__info { min-width: 0; }
.ck-item__name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.ck-item__code { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ck-item__unit { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ck-item__price { font-size: 14px; font-weight: 600; white-space: nowrap; }
.ck-item__remove { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.ck-item__remove:hover { color: var(--danger); }

.ck-qty { display: flex; align-items: center; gap: 8px; }
.ck-qty__btn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-alt); color: var(--text); font-size: 15px; cursor: pointer; }
.ck-qty__btn:hover { background: color-mix(in srgb, var(--surface-alt) 70%, var(--text) 10%); }
.ck-qty__val { width: 40px; height: 30px; text-align: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-alt); font-size: 13px; color: var(--text); }

/* ---------- форма ---------- */
.ck-form { display: flex; flex-direction: column; gap: 16px; }
.ck-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ck-field { display: flex; flex-direction: column; gap: 6px; }
.ck-field label { font-size: 12px; color: var(--muted); }
.ck-field input, .ck-field textarea {
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface-alt);
    padding: 0 14px; height: 46px; font-size: 14px; color: var(--text); outline: none; font-family: inherit;
}
.ck-field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.ck-field input:focus, .ck-field textarea:focus { border-color: var(--accent); }
.ck-field input.is-invalid, .ck-field textarea.is-invalid { border-color: var(--danger); }
.ck-error { font-size: 12px; color: var(--danger); min-height: 0; }
.ck-error:empty { display: none; }

/* ---------- опции доставки/оплаты ---------- */
.ck-options { display: flex; flex-direction: column; gap: 12px; }
.ck-opt {
    display: flex; align-items: center; gap: 14px;
    padding: 14px; border-radius: 14px; border: 1.5px solid var(--border); cursor: pointer;
}
.ck-opt.is-selected { border-color: var(--accent); }
.ck-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ck-opt__dot { position: relative; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--border); box-sizing: border-box; }
.ck-opt.is-selected .ck-opt__dot { border-color: var(--accent); }
.ck-opt.is-selected .ck-opt__dot::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ck-opt__label { flex: 1; font-size: 14px; font-weight: 500; }
.ck-opt__meta { font-size: 13px; color: var(--muted); }
.ck-opt__label--pay { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-weight: 500; }
.ck-opt__pay { height: 26px; display: flex; align-items: center; }
.ck-opt__pay img { height: 100%; width: auto; max-width: 130px; object-fit: contain; display: block; }
/* dual-логотип idram: показываем ровно одну версию по теме */
.ck-opt__pay .pay-logo--light { display: block; }
.ck-opt__pay .pay-logo--dark  { display: none; }
[data-theme="dark"] .ck-opt__pay .pay-logo--light { display: none; }
[data-theme="dark"] .ck-opt__pay .pay-logo--dark  { display: block; }
.ck-payment-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding-top: 12px; margin-top: 4px; border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }

/* ---------- сводка ---------- */
.ck-summary { /* в потоке правой колонки, не sticky */ }
.ck-sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); padding: 5px 0; }
.ck-sum-row span:last-child { color: var(--text); }
.ck-sum-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding-top: 12px; margin-top: 6px; border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.ck-place {
    width: 100%; margin-top: 16px; padding: 15px; border: 0; border-radius: 980px;
    background: var(--accent); color: var(--accent-text); font-size: 15px; font-weight: 500; cursor: pointer;
}
.ck-place:hover { opacity: .85; }
.ck-place:disabled { opacity: .5; cursor: default; }
.ck-place-error { font-size: 13px; color: var(--danger); text-align: center; margin-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .ck-layout { grid-template-columns: 1fr; }

}
@media (max-width: 560px) {
    .ck-layout { padding: 16px 16px 48px; }
    .ck-row { grid-template-columns: 1fr; }
    .ck-item { grid-template-columns: 52px 1fr auto; grid-template-areas: "photo info remove" "photo qty price"; gap: 10px 12px; }
    .ck-item__photo { grid-area: photo; width: 52px; height: 52px; }
    .ck-item__info { grid-area: info; }
    .ck-qty { grid-area: qty; }
    .ck-item__price { grid-area: price; text-align: right; align-self: center; }
    .ck-item__remove { grid-area: remove; justify-self: end; }
}

/* ---------- пустое состояние ---------- */
.ck-empty {
    width: 100%; max-width: 1280px; margin: 0 auto; padding: 64px 24px 96px;
    display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.ck-empty[hidden] { display: none; }
.ck-empty__icon {
    width: 96px; height: 96px; border-radius: 50%;
    background: var(--surface-alt); color: var(--muted);
    display: grid; place-items: center;
}
.ck-empty__title { font-size: 22px; font-weight: 600; }
.ck-empty__text { font-size: 15px; color: var(--muted); }
.ck-empty__btn {
    margin-top: 6px; padding: 14px 32px; border-radius: 980px;
    background: var(--accent); color: var(--accent-text);
    font-weight: 500; font-size: 15px; text-decoration: none;
}
.ck-empty__btn:hover { opacity: .85; }
.ck-layout[hidden] { display: none; }