/* Оформление подарочного сертификата. Всё под .cw, чтобы не задеть тему. */
.cw {
    --cw-surface: #FFFFFF;
    --cw-ink: #111A2E;
    --cw-soft: #55607A;
    --cw-line: #DCE1EC;
    --cw-brand: #214899;
    --cw-brand-soft: #E7EDFA;
    --cw-ball: #E4F24A;
    --cw-error: #B42318;
    font-family: var(--body-font, "Jost", sans-serif);
    color: var(--cw-ink);
    margin-bottom: 40px;
}
.cw *, .cw *::before, .cw *::after { box-sizing: border-box; }
.cw h2, .cw p { margin: 0; }
.cw button, .cw input, .cw textarea { font: inherit; color: inherit; }
.cw :focus-visible { outline: 3px solid var(--cw-brand); outline-offset: 2px; }
.cw-empty { font-size: 18px; color: var(--cw-soft); }

.cw-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }

.cw-wizard { background: var(--cw-surface); border: 1px solid var(--cw-line); border-radius: 18px; padding: 22px; display: grid; gap: 22px; }

.cw-stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.cw-stepper button {
    width: 100%; border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
    display: grid; gap: 6px; color: var(--cw-soft); font-size: 13px; line-height: 1.2;
}
.cw-stepper .rail { height: 4px; border-radius: 4px; background: var(--cw-line); }
.cw-stepper .done .rail, .cw-stepper .current .rail { background: var(--cw-brand); }
.cw-stepper .current { color: var(--cw-ink); font-weight: 600; }

.cw-head { display: grid; gap: 4px; }
.cw-no { font-size: 13px; color: var(--cw-brand); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cw-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; color: var(--cw-ink); }
.cw-head p { color: var(--cw-soft); font-size: 15px; }

.cw-panel { display: grid; gap: 18px; }
.cw-panel[hidden] { display: none; }

.cw-choices { display: grid; gap: 10px; }
.cw-choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cw-choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cw-choices.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cw-choice {
    border: 1.5px solid var(--cw-line); border-radius: 14px; background: var(--cw-surface);
    padding: 14px; cursor: pointer; text-align: left; display: grid; gap: 4px; align-content: start;
    transition: border-color .15s, background-color .15s;
}
.cw-choice:hover { border-color: var(--cw-brand); }
.cw-choice[aria-pressed="true"] { border-color: var(--cw-brand); background: var(--cw-brand-soft); box-shadow: 0 0 0 1px var(--cw-brand) inset; }
.cw-choice b { font-weight: 600; font-size: 16px; }
.cw-choice small { color: var(--cw-soft); font-size: 13.5px; line-height: 1.35; }
.cw-choice .ico { font-size: 22px; line-height: 1; margin-bottom: 4px; color: var(--cw-brand); }
.cw-choice.amount b { font-family: "PT Sans Caption", "PT Sans", sans-serif; font-size: 18px; font-variant-numeric: tabular-nums; }

.cw-designs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cw-design { border: 1.5px solid var(--cw-line); border-radius: 14px; background: var(--cw-surface); padding: 8px 8px 10px; cursor: pointer; display: grid; gap: 8px; text-align: left; }
.cw-design:hover { border-color: var(--cw-brand); }
.cw-design[aria-pressed="true"] { border-color: var(--cw-brand); box-shadow: 0 0 0 1px var(--cw-brand) inset; }
.cw-design .pdl-cert { border-radius: 9px; }
.cw-design .pdl-cert .pc-logo { width: 16cqw; height: 16cqw; left: 7cqw; top: 7cqw; box-shadow: none; }
.cw-design b { font-size: 14.5px; font-weight: 600; padding-inline: 4px; }
.cw-design small { font-size: 12.5px; color: var(--cw-soft); padding-inline: 4px; margin-top: -6px; }
/* переключатель «Добавить мистера Х» */
.cw .cw-mrx {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left;
    border: 1.5px solid var(--cw-line); border-radius: 14px; background: linear-gradient(115deg, #0E1024 0%, #1D1430 100%);
    color: #FFFFFF; padding: 12px 14px; cursor: pointer;
}
.cw-mrx img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 154, 82, .7); }
.cw-mrx b { display: block; font-weight: 600; font-size: 15.5px; }
.cw-mrx small { display: block; color: #D9CFE3; font-size: 13px; line-height: 1.35; }
.cw-mrx[aria-checked="true"] { border-color: #FF9A52; box-shadow: 0 0 0 1px #FF9A52 inset; }
.cw-switch { width: 44px; height: 26px; border-radius: 99px; background: rgba(255, 255, 255, .25); position: relative; transition: background .2s; }
.cw-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; transition: transform .2s; }
.cw-mrx[aria-checked="true"] .cw-switch { background: #FF9A52; }
.cw-mrx[aria-checked="true"] .cw-switch::after { transform: translateX(18px); }
/* «Нужен печатный сертификат» — тот же переключатель, светлый */
.cw .cw-print {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; width: 100%;
    margin-top: 12px; border: 1.5px solid var(--cw-line); border-radius: 14px; background: var(--cw-surface);
    color: var(--cw-ink); padding: 12px 14px; cursor: pointer;
}
.cw-print:hover { border-color: var(--cw-brand); }
.cw-print-ico { width: 44px; height: 44px; color: var(--cw-brand); }
.cw-print b { display: block; font-weight: 600; font-size: 15.5px; }
.cw-print small { display: block; color: var(--cw-soft); font-size: 13px; line-height: 1.35; }
.cw-print .cw-switch { background: var(--cw-line); }
.cw-print[aria-checked="true"] { border-color: var(--cw-brand); background: var(--cw-brand-soft); box-shadow: 0 0 0 1px var(--cw-brand) inset; }
.cw-print[aria-checked="true"] .cw-switch { background: var(--cw-brand); }
.cw-print[aria-checked="true"] .cw-switch::after { transform: translateX(18px); }

/* «Своё фото»: пока фото нет — заглушка с логотипом и плюсом */
.cw-design.is-photo { border-style: dashed; }
.cw-design.is-photo[aria-pressed="true"] { border-style: solid; }
.cw-design .pdl-cert .pc-upload {
    position: absolute; right: 8cqw; bottom: 8cqw; width: 22cqw; height: 22cqw; border-radius: 50%;
    display: grid; place-items: center; background: var(--cw-ball); color: #1B1F00;
    font-size: 16cqw; line-height: 1; font-weight: 400;
}
.cw-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px; border-radius: 14px; background: var(--cw-brand-soft); }
.cw-photo[hidden] { display: none; }
.cw-photo .cw-hint { flex: 1 1 240px; }
.cw-photo .cw-error { flex-basis: 100%; }
.cw-choice.amount.custom { border-style: dashed; }
.cw-choice.amount.custom[aria-pressed="true"] { border-style: solid; }
.cw .cw-field.has-error input#cw-custom { border-color: var(--cw-error); }
#cw-custom { font-family: "PT Sans Caption", "PT Sans", sans-serif; font-size: 20px; font-variant-numeric: tabular-nums; max-width: 240px; }
.cw-link { justify-self: start; border: 0; background: none; color: var(--cw-brand); cursor: pointer; padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.cw-link[hidden] { display: none; }

.cw-field { display: grid; gap: 6px; }
.cw-field[hidden] { display: none; }
.cw-field label, .cw-lbl { font-size: 14px; font-weight: 500; }
.cw .cw-field input, .cw .cw-field textarea {
    width: 100%; height: auto; border: 1.5px solid var(--cw-line); border-radius: 12px; background: var(--cw-surface);
    padding: 11px 14px; font-size: 16px; line-height: 1.4;
}
.cw .cw-field input:focus, .cw .cw-field textarea:focus { border-color: var(--cw-brand); outline: none; box-shadow: 0 0 0 3px var(--cw-brand-soft); }
.cw .cw-field input[hidden] { display: none; }
.cw .cw-field textarea { resize: vertical; min-height: 104px; }
.cw-hint { font-size: 13px; color: var(--cw-soft); display: flex; justify-content: space-between; gap: 12px; }
.cw-error { font-size: 14px; color: var(--cw-error); }
.cw-error[hidden] { display: none; }
.cw .cw-field.has-error input { border-color: var(--cw-error); }
.cw-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.cw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-chip { border: 1.5px solid var(--cw-line); background: var(--cw-surface); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14.5px; }
.cw-chip:hover { border-color: var(--cw-brand); }
.cw-chip[aria-pressed="true"] { border-color: var(--cw-brand); background: var(--cw-brand); color: #FFFFFF; }

/* шрифт поздравления: каждая кнопка написана своим шрифтом */
.cw-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cw-font { display: grid; gap: 4px; justify-items: start; text-align: left; border: 1.5px solid var(--cw-line); background: var(--cw-surface); color: var(--cw-ink); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.cw-font:hover { border-color: var(--cw-brand); }
.cw-font[aria-pressed="true"] { border-color: var(--cw-brand); background: var(--cw-brand-soft); box-shadow: inset 0 0 0 1px var(--cw-brand); }
.cw-font-sample { font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cw-font[data-font="caveat"] .cw-font-sample { font-size: 22px; line-height: 1; padding-right: .2em; }
.cw-font[data-font="unbounded"] .cw-font-sample { font-size: 14px; line-height: 1.45; }
.cw-font small { font-size: 12.5px; color: var(--cw-soft); }

.cw-summary { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--cw-line); border-radius: 14px; overflow: hidden; }
.cw-summary li { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--cw-line); align-items: baseline; margin: 0; }
.cw-summary li:first-child { border-top: 0; }
.cw-summary span:first-child { color: var(--cw-soft); font-size: 14px; }
.cw-summary .edit { border: 0; background: none; color: var(--cw-brand); cursor: pointer; font-size: 14px; padding: 0; }
.cw-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.cw-total b { font-family: "PT Sans Caption", "PT Sans", sans-serif; font-size: 24px; font-variant-numeric: tabular-nums; }
.cw-notice { font-size: 14px; color: var(--cw-soft); background: var(--cw-brand-soft); border-radius: 12px; padding: 12px 14px; }

.cw-nav { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--cw-line); padding-top: 18px; }
.cw-btn { border-radius: 999px; padding: 12px 22px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--cw-line); background: var(--cw-surface); }
.cw-btn:hover { border-color: var(--cw-brand); }
.cw-btn[hidden] { display: none; }
.cw-btn:disabled { opacity: .5; cursor: progress; }
#cw-next { margin-left: auto; }
.cw-btn.primary { background: var(--cw-ball); border-color: var(--cw-ball); color: #1B1F00; }
.cw-btn.primary:hover { filter: brightness(.96); }

.cw-preview { position: sticky; top: 110px; display: grid; gap: 12px; }
.cw-preview-label { font-size: 13px; color: var(--cw-soft); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.cw-preview .pdl-cert { box-shadow: 0 24px 50px -24px rgba(17, 26, 46, .55), 0 2px 6px rgba(17, 26, 46, .12); }
.cw-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--cw-soft); }
.cw-meta b { color: var(--cw-ink); font-weight: 600; }
.cw-meta-note { font-size: 13px; color: var(--cw-soft); }

@media (max-width: 991px) {
    .cw-layout { grid-template-columns: minmax(0, 1fr); }
    .cw-preview { position: static; order: -1; }
}
@media (max-width: 575px) {
    .cw-choices.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-choices.cols-3, .cw-choices.cols-2 { grid-template-columns: minmax(0, 1fr); }
    /* номиналы на телефоне — по два в ряд, «Своя сумма» на всю ширину */
    #cw-amounts.cw-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #cw-amounts .cw-choice.custom { grid-column: 1 / -1; }
    #cw-custom { max-width: none; }
    .cw-designs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-row2 { grid-template-columns: minmax(0, 1fr); }
    .cw-stepper .name { display: none; }
    .cw-summary li { grid-template-columns: 1fr auto; }
    .cw-summary li span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .cw-wizard { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .cw * { transition: none !important; }
}
