/* Конструктор сертификатов и страницы шаблонов. Стиль — как у главной giveasy.ru:
   белый фон, чёрный текст и кнопки, салатовый акцент, светло-серые карточки, Inter Tight. */
:root {
    --k-ink: #000000;
    --k-ink-2: #3a3a3a;
    --k-muted: #767676;
    --k-bg: #ffffff;
    --k-card: #f5f5f5;
    --k-line: #e3e3e3;
    --k-lime: #e1ef4d;
    --k-lime-2: #d4e33a;
    --k-radius: 20px;
    --k-font: "Inter Tight", Arial, sans-serif;
}
* { box-sizing: border-box; }
/* Свои display у окна и вкладок не должны перебивать атрибут hidden. */
[hidden] { display: none !important; }
.k-body { margin: 0; background: var(--k-bg); color: var(--k-ink); font: 17px/1.5 var(--k-font); }
.k-body img { max-width: 100%; }
.k-wrap { max-width: 1340px; margin: 0 auto; padding-inline: 50px; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
h1 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 18px; }
h2 { font-size: clamp(24px, 2.8vw, 36px); line-height: 1.12; letter-spacing: -0.015em; margin: 64px 0 20px; }

/* шапка: логотип слева, чёрная «пилюля» справа — как на главной */
.k-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); }
.k-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 30px; }
.k-logo img { display: block; width: 208px; height: auto; }
.k-pill { display: flex; align-items: center; gap: 4px; background: #000; color: #fff; border-radius: 3000px; padding: 6px; position: relative; }
.k-pill__link { color: #fff; text-decoration: none; padding: 8px 16px; font-size: 16px; font-weight: 500; }
.k-pill__cta { background: #fff; color: #000; text-decoration: none; padding: 9px 20px; border-radius: 3000px; font-size: 16px; font-weight: 500; }
.k-pill__cta:hover { background: var(--k-lime); }
.k-menu summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; }
.k-menu summary::-webkit-details-marker { display: none; }
.k-burger, .k-burger::before { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; position: relative; }
.k-burger { margin: 4px 0; }
.k-burger::before { content: ""; position: absolute; top: 7px; }
.k-burger { top: -3px; }
.k-menu__list { position: absolute; top: calc(100% + 10px); right: 0; background: #000; border-radius: 20px; padding: 14px; min-width: 280px;
    display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.k-menu__list a { color: #fff; text-decoration: none; padding: 9px 12px; border-radius: 10px; font-size: 16px; }
.k-menu__list a:hover, .k-menu__list a.is-active { background: #1f1f1f; color: var(--k-lime); }

/* кнопки */
.k-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
    background: #000; color: #fff; font: 600 17px/1.2 var(--k-font); padding: 17px 26px; border-radius: 12px;
    text-decoration: none; transition: background .15s, color .15s; }
.k-btn:hover { background: #222; }
.k-btn--lime { background: var(--k-lime); color: #000; }
.k-btn--lime:hover { background: var(--k-lime-2); }
.k-btn:disabled { opacity: .6; cursor: progress; }
.k-btn--ghost { background: var(--k-card); color: #000; }
.k-btn--ghost:hover { background: #ebebeb; }
.k-btn--ghost-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.k-btn--ghost-light:hover { background: rgba(255,255,255,.1); }
.k-btn--wide { width: 100%; }
.k-btn:focus-visible, .k-tab:focus-visible, .k-seg button:focus-visible, .k-card:focus-visible, .k-menu summary:focus-visible { outline: 3px solid var(--k-lime-2); outline-offset: 2px; }
.k-link { background: none; border: 0; padding: 0; color: var(--k-ink); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* первый экран */
.k-hero { padding-block: 36px 28px; }
.k-lead { color: var(--k-ink-2); font-size: 19px; max-width: 60ch; margin: 0 0 26px; }
.k-crumbs { font-size: 15px; color: var(--k-muted); margin-bottom: 14px; }
.k-crumbs a { color: var(--k-muted); }

/* редактор */
.k-editor { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: start; padding-bottom: 24px; }
.k-stage { position: sticky; top: 100px; min-width: 0; }
.k-canvas-wrap { background: var(--k-card); border-radius: var(--k-radius); padding: 24px; }
#k-canvas { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; border-radius: 12px; touch-action: none; cursor: grab;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .14); }
#k-canvas.is-dragging { cursor: grabbing; }
.k-hint { color: var(--k-muted); font-size: 15px; margin: 12px 4px; }
.k-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.k-panel { background: var(--k-card); border-radius: var(--k-radius); padding: 18px; min-width: 0; }
.k-tabs { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; background: #e9e9e9; border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.k-tab { border: 0; background: transparent; padding: 10px 6px; border-radius: 10px; font: 600 14px var(--k-font); color: var(--k-ink-2); cursor: pointer; white-space: nowrap; }
.k-tab.is-active { background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.k-pane { display: flex; flex-direction: column; gap: 16px; }
.k-field { display: flex; flex-direction: column; gap: 7px; font-size: 15px; color: var(--k-ink-2); }
.k-field > span { font-weight: 600; color: #000; }
.k-field--row { flex-direction: row; align-items: center; justify-content: space-between; }
.k-field input[type=text], .k-field input[type=email], .k-field input[type=url], .k-field select, .k-block textarea, .k-block input[type=text] {
    width: 100%; border: 1px solid var(--k-line); border-radius: 10px; padding: 11px 12px; font: 16px var(--k-font); color: #000; background: #fff; }
.k-field input:focus, .k-field select:focus, .k-block input:focus, .k-block textarea:focus { outline: 2px solid #000; border-color: transparent; }
.k-field input[type=color] { width: 48px; height: 36px; border: 1px solid var(--k-line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.k-field input[type=range], .k-block__size input { width: 100%; accent-color: #000; }
.k-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.k-seg button { border: 1px solid var(--k-line); background: #fff; padding: 9px 13px; border-radius: 10px; font: 500 15px var(--k-font); color: var(--k-ink-2); cursor: pointer; }
.k-seg button.is-active { border-color: #000; background: #000; color: #fff; }
.k-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.k-thumbs button { border: 3px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 8 / 5; }
.k-thumbs button.is-active { border-color: #000; }
.k-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.k-upload { display: inline-flex; position: relative; overflow: hidden; }
.k-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.k-upload span { display: inline-block; background: #fff; border: 1px dashed #000; color: #000; border-radius: 10px; padding: 11px 15px; font-weight: 600; font-size: 15px; }
.k-note { margin: 0; font-size: 14px; color: var(--k-muted); }
.k-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--k-ink-2); cursor: pointer; }
.k-check input { margin-top: 3px; accent-color: #000; width: 17px; height: 17px; flex: none; }
.k-check a { color: #000; }
.k-reset { margin-top: 20px; font-size: 15px; color: var(--k-muted); }

.k-blocks { display: flex; flex-direction: column; gap: 8px; }
.k-block { background: #fff; border: 1px solid var(--k-line); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 8px; }
.k-block.is-selected { border-color: #000; box-shadow: 0 0 0 2px var(--k-lime); }
.k-block.is-off .k-block__body { display: none; }
.k-block__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 15px; }
.k-block__head label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.k-block__head input { accent-color: #000; width: 17px; height: 17px; }
.k-block__body { display: flex; flex-direction: column; gap: 6px; }
.k-block textarea { resize: vertical; min-height: 44px; }
.k-block__size { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--k-muted); }

/* окно с формой */
.k-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.k-modal__box { background: #fff; border-radius: 24px; padding: 32px; width: min(480px, 100%); position: relative; max-height: 100%; overflow-y: auto; }
.k-modal__box h2 { margin: 0 0 10px; font-size: 28px; }
.k-modal__box p { color: var(--k-ink-2); margin: 0 0 18px; }
.k-modal__close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--k-muted); cursor: pointer; }
#k-form { display: flex; flex-direction: column; gap: 14px; }
.k-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.k-error { color: #c62f3a; font-size: 15px; margin: 0; }
.k-done-sell { background: var(--k-card); border-radius: 16px; padding: 18px; }
.k-done-sell p { margin-bottom: 14px; }

/* контент */
.k-content { padding-bottom: 80px; }
.k-steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; counter-reset: step; }
.k-steps li { background: var(--k-card); border-radius: var(--k-radius); padding: 24px; color: var(--k-ink-2); counter-increment: step; }
.k-steps li::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--k-lime); color: #000; font-weight: 600; margin-bottom: 16px; }
.k-steps strong { color: #000; display: block; margin-bottom: 4px; }
.k-faq { display: grid; gap: 10px; max-width: 900px; }
.k-faq details { background: var(--k-card); border-radius: 16px; padding: 20px 24px; }
.k-faq summary { cursor: pointer; font-weight: 600; font-size: 18px; }
.k-faq p { margin: 12px 0 0; color: var(--k-ink-2); }
.k-article { max-width: 780px; }
.k-article p { color: var(--k-ink-2); }
.k-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.k-section-head a { font-weight: 600; text-decoration: none; }
.k-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.k-card { position: relative; display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 8 / 5; background: var(--k-card); }
.k-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.k-card__label { position: absolute; left: 14px; bottom: 14px; background: var(--k-lime); color: #000; font-weight: 600; font-size: 15px;
    padding: 8px 14px; border-radius: 10px; opacity: 0; transform: translateY(6px); transition: .2s; }
.k-card:hover img { transform: scale(1.03); }
.k-card:hover .k-card__label, .k-card:focus-visible .k-card__label { opacity: 1; transform: none; }
.k-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.k-chips a { background: var(--k-card); padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 500; }
.k-chips a:hover { background: var(--k-lime); }

.k-sell { margin-top: 72px; background: #000; color: #fff; border-radius: 28px; padding: clamp(28px, 4vw, 52px); display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.k-sell h2 { margin-top: 0; color: #fff; }
.k-sell p, .k-sell li { color: #cfcfcf; }
.k-sell ul { padding-left: 20px; display: grid; gap: 6px; margin: 0 0 28px; }
.k-sell__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.k-sell__case { background: var(--k-lime); color: #000; border-radius: 22px; padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.k-sell__num { font-size: clamp(34px, 4vw, 48px); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* подвал — как на главной */
.k-footer { background: #000; color: #fff; padding-block: 64px 48px; font-size: 15px; }
.k-footer__in { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 32px; }
.k-footer__col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.k-footer__brand img { width: 238px; height: auto; display: block; }
.k-footer__brand p { color: #a3a3a3; margin: 10px 0 0; line-height: 1.55; }
.k-footer a { color: #fff; text-decoration: none; }
.k-footer a:hover { color: var(--k-lime); }
.k-footer__muted, .k-footer a.k-footer__muted { color: #8c8c8c; }
.k-footer__gap { margin-top: 24px; }
.k-pay { display: flex; gap: 10px; margin-top: 24px; }
.k-pay img { width: 30px; height: 30px; }

@media (max-width: 1100px) {
    .k-editor { grid-template-columns: 1fr; }
    .k-stage { position: static; }
    .k-sell { grid-template-columns: 1fr; }
    .k-footer__in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .k-wrap { padding-inline: 16px; }
    .k-header__in { padding: 14px 16px; }
    .k-logo img { width: 150px; }
    .k-pill__link { display: none; }
    .k-pill { padding: 4px; }
    .k-menu summary { padding: 8px 10px; }
    .k-pill__cta { font-size: 15px; padding: 7px 14px; }
    .k-canvas-wrap { padding: 10px; }
    .k-actions .k-btn { width: 100%; }
    .k-footer__in { grid-template-columns: 1fr; }
    .k-thumbs { grid-template-columns: repeat(2, 1fr); }
    .k-tabs { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .k-card img, .k-card__label { transition: none; } }
