/* Конструктор /design */
.ctor {
	--ctor-accent: #ff5c27;
	--ctor-accent-d: #e04a17;
	--ctor-line: #e3e3e3;
	--ctor-bg: #f6f6f6;
	--ctor-text: #333;
	--ctor-muted: #777;
	--ctor-err: #c62828;
	--ctor-ok: #2e7d32;
	color: var(--ctor-text);
	margin-bottom: 40px;
}
.ctor *, .ctor *::before, .ctor *::after { box-sizing: border-box; }
.ctor [hidden] { display: none !important; }
body.ctor-lock { overflow: hidden; }

.ctor-h { margin: 0 0 12px; font-size: 20px; line-height: 1.2; }
.ctor-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ctor-muted); margin-bottom: 4px; }
.ctor-hint { font-size: 13px; color: var(--ctor-muted); margin-top: 6px; }
.ctor-error { color: var(--ctor-err); font-size: 13px; margin-top: 6px; }
.ctor-ok { color: var(--ctor-ok); font-size: 14px; margin-top: 10px; }
.ctor-empty { padding: 16px 8px; text-align: center; color: var(--ctor-muted); font-size: 14px; }
.ctor-link { background: none; border: 0; padding: 0; color: var(--ctor-accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* кнопки */
.ctor-btn {
	display: inline-block; min-height: 40px; padding: 8px 16px; border: 1px solid var(--ctor-line); background: #fff;
	color: var(--ctor-text); font: inherit; font-size: 14px; cursor: pointer; border-radius: 3px; text-align: center; line-height: 1.25;
}
.ctor-btn:hover:not(:disabled) { border-color: var(--ctor-accent); color: var(--ctor-accent); }
.ctor-btn:disabled { opacity: .5; cursor: not-allowed; }
.ctor-btn--accent { background: var(--ctor-accent); border-color: var(--ctor-accent); color: #fff; font-weight: 600; }
.ctor-btn--accent:hover:not(:disabled) { background: var(--ctor-accent-d); border-color: var(--ctor-accent-d); color: #fff; }
.ctor-btn--outline { border-color: var(--ctor-accent); color: var(--ctor-accent); }
.ctor-btn--block { display: block; width: 100%; }
.ctor-btn--sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.ctor-btn--lg { min-height: 48px; padding: 12px 28px; font-size: 16px; }
.ctor :focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

/* сетка: две колонки */
.ctor-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
.ctor-side { border: 1px solid var(--ctor-line); background: #fff; padding: 16px; border-radius: 3px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.ctor-side__head { display: flex; justify-content: space-between; align-items: center; }
.ctor-side__close { display: none; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; padding: 0 8px; }
.ctor-upload { margin-bottom: 14px; border: 2px dashed transparent; border-radius: 3px; }
.ctor-upload.is-drop, .ctor-stage.is-drop { border-color: var(--ctor-accent); background: #fff5f1; }

.ctor-cats { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--ctor-line); }
.ctor-cats li { margin: 0; padding: 0; border-bottom: 1px solid var(--ctor-line); }
.ctor-cat { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; padding: 10px 6px; font: inherit; font-size: 14px; text-transform: uppercase; cursor: pointer; text-align: left; }
.ctor-cat span { flex: 1; }
.ctor-cat em { font-style: normal; color: var(--ctor-muted); font-size: 12px; }
.ctor-cat:hover, .ctor-cat.is-on { color: var(--ctor-accent); }
.ctor-cat.is-on { font-weight: 700; }

.ctor-panel-prints { overflow-y: auto; scrollbar-gutter: stable; padding: 4px 0 8px; scrollbar-width: thin; overscroll-behavior: contain; }
.ctor-prints { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ctor-prints .ctor-empty, .ctor-prints .ctor-error, .ctor-prints .ctor-hint, .ctor-prints .ctor-btn { grid-column: 1 / -1; }
.ctor-cat::after { content: '\203A'; margin-left: 8px; transition: transform .15s; font-size: 18px; line-height: 1; }
.ctor-cat[aria-expanded="true"]::after { transform: rotate(90deg); }
.ctor-pthumb { padding: 0; border: 2px solid transparent; background: var(--ctor-bg); cursor: pointer; aspect-ratio: 1; overflow: hidden; border-radius: 3px; }
.ctor-pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctor-pthumb:hover { border-color: #ffc3ae; }
.ctor-pthumb.is-on { border-color: var(--ctor-accent); }

/* блок «Изделие» */
.ctor-block { margin-bottom: 16px; }
.ctor-block__title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ctor-selected { font-size: 14px; color: var(--ctor-muted); }
.ctor-chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
.ctor-groups { margin-bottom: 12px; position: relative; }
.ctor-chip { min-height: 38px; padding: 6px 16px; border: 1px solid var(--ctor-line); background: #fff; border-radius: 20px; cursor: pointer; font: inherit; font-size: 14px; white-space: nowrap; }
.ctor-chip.is-on { background: var(--ctor-accent); border-color: var(--ctor-accent); color: #fff; }
.ctor-chip:not(.is-on):hover { border-color: var(--ctor-accent); color: var(--ctor-accent); }
.ctor-select { display: none; width: 100%; min-height: 42px; padding: 6px 10px; border: 1px solid var(--ctor-line); border-radius: 3px; font: inherit; background: #fff; }
.ctor-groups--select .ctor-chips { visibility: hidden; height: 0; }
.ctor-groups--select .ctor-select { display: block; }

.ctor-strip { display: flex; align-items: stretch; gap: 8px; }
.ctor-strip__scroll { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scroll-behavior: smooth; padding: 2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.ctor-arrow { flex: none; width: 36px; border: 1px solid var(--ctor-line); background: #fff; font-size: 26px; cursor: pointer; border-radius: 3px; }
.ctor-arrow:disabled { opacity: .35; cursor: default; }
.ctor-pcard { flex: none; width: 96px; padding: 6px 4px; border: 2px solid var(--ctor-line); background: #fff; cursor: pointer; text-align: center; border-radius: 3px; font: inherit; font-size: 12px; line-height: 1.2; color: var(--ctor-text); }
.ctor-pcard img { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto 4px; }
.ctor-pcard span { display: block; overflow: hidden; text-overflow: ellipsis; }
.ctor-pcard:hover { border-color: #ffc3ae; }
.ctor-pcard.is-on { border-color: var(--ctor-accent); }

/* сцена */
.ctor-pick-mobile { display: none; width: 100%; margin-bottom: 12px; }
.ctor-stage { position: relative; border: 2px solid transparent; }
.ctor-stage__box { position: relative; width: 100%; background: #fff; border: 1px solid var(--ctor-line); min-height: 280px; overflow: hidden; max-width: 760px; margin: 0 auto; }
.ctor-stage__box canvas { position: absolute; left: 0; top: 0; display: block; }
.ctor-stage__empty { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; padding: 0 12px; font-size: 15px; color: var(--ctor-muted); pointer-events: none; }
.ctor-stage__busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.65); font-size: 14px; z-index: 2; }
.ctor-spin { width: 20px; height: 20px; border: 3px solid #ddd; border-top-color: var(--ctor-accent); border-radius: 50%; animation: ctorspin .8s linear infinite; }
@keyframes ctorspin { to { transform: rotate(360deg); } }
.ctor-stage__msg { max-width: 760px; margin: 8px auto 0; padding: 8px 12px; background: #fff7e6; border: 1px solid #ffd591; font-size: 14px; border-radius: 3px; }

/* панель */
.ctor-panel { max-width: 760px; margin: 14px auto 0; padding: 14px 16px; border: 1px solid var(--ctor-line); background: #fff; border-radius: 3px; }
.ctor-panel__row { margin-bottom: 12px; }
.ctor-panel__info { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ctor-printname { font-weight: 600; word-break: break-word; }
.ctor-actions { display: flex; gap: 8px; flex: none; }
.ctor-variants { display: flex; flex-wrap: wrap; gap: 6px; }
.ctor-var { padding: 0; width: 48px; height: 48px; border: 2px solid transparent; cursor: pointer; background: var(--ctor-bg); border-radius: 3px; overflow: hidden; }
.ctor-var img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctor-var.is-on { border-color: var(--ctor-accent); }
.ctor-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.ctor-seg label { margin: 0; font-weight: 400; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--ctor-line); border-radius: 3px; }
.ctor-seg input { margin: 0; }
.ctor-tools { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: end; }
.ctor-tool { display: block; margin: 0; font-weight: 400; }
.ctor-tool input[type=range] { width: 100%; accent-color: var(--ctor-accent); margin: 8px 0 0; }
.ctor-tool output { font-size: 13px; color: var(--ctor-muted); }
.ctor-tool--btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.ctor-rot { display: flex; gap: 6px; align-items: center; }
.ctor-rot input { width: 72px; min-height: 36px; border: 1px solid var(--ctor-line); border-radius: 3px; text-align: center; font: inherit; }
.ctor-send { max-width: 760px; margin: 18px auto 0; }

/* модальные окна */
.ctor-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ctor-modal__back { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.ctor-modal__dlg { position: relative; background: #fff; border-radius: 4px; width: 100%; max-width: 920px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; }
.ctor-modal__dlg--sm { max-width: 520px; }
.ctor-modal__x { position: absolute; right: 10px; top: 6px; width: 40px; height: 40px; background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer; }
.ctor-modal__tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.ctor-search { display: flex; gap: 6px; }
.ctor-search input { min-height: 36px; padding: 4px 10px; border: 1px solid var(--ctor-line); border-radius: 3px; font: inherit; width: 220px; max-width: 100%; }
.ctor-grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.ctor-grid-products .ctor-pcard { width: auto; }
.ctor-modal__foot { display: flex; gap: 10px; margin-top: 16px; }
.ctor-send__top { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.ctor-send__top img { width: 110px; height: 110px; object-fit: contain; border: 1px solid var(--ctor-line); background: #fff; flex: none; }
/* поля формы — как на остальных формах сайта (bootstrap form-control) */
.ctor-field { display: block; margin: 0 0 15px; font-weight: 400; }
.ctor-field > span:first-child { display: block; font-size: 14px; font-weight: bold; color: #555; margin-bottom: 5px; }
.ctor-field > span:first-child b { color: #e74c3c; font-weight: normal; }
.ctor-field input, .ctor-field textarea {
	display: block; width: 100%; height: 34px; padding: 6px 12px; font: inherit; font-size: 14px; line-height: 1.42857143; color: #555;
	background: #fff; border: 1px solid #ccc; border-radius: 0; box-shadow: none; outline: 0;
}
.ctor-field textarea { height: auto; min-height: 80px; }
.ctor-field input:focus, .ctor-field textarea:focus { border-color: #bbb; box-shadow: 0 0 2px #c9c9c9; outline: 0; }
.ctor-field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ctor-check { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-weight: 400; font-size: 13px; }
.ctor-check input { margin-top: 3px; flex: none; width: 18px; height: 18px; }

/* планшет: колонка уже */
@media (max-width: 1199px) {
	.ctor-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
}

/* мобильный */
@media (max-width: 767px) {
	.ctor-grid { display: block; }
	.ctor-pick-mobile { display: block; }
	.ctor-side {
		display: none; position: fixed; inset: 0; z-index: 10040; max-height: none; border: 0; border-radius: 0; overflow-y: auto; padding: 14px;
	}
	.ctor-side.is-open { display: block; }
	.ctor-side__close { display: block; }
	body.ctor-lock-m { overflow: hidden; }
	.ctor-chips { display: none; }
	.ctor-select { display: block; }
	.ctor-groups--select .ctor-chips { display: none; }
	.ctor-arrow { display: none; }
	.ctor-strip { flex-wrap: wrap; }
	.ctor-strip__scroll { flex: 1 1 100%; overflow-x: auto; scroll-snap-type: x proximity; }
	.ctor-pcard { scroll-snap-align: start; width: 84px; }
	.ctor-pcard img { width: 60px; height: 60px; }
	.ctor-tools { grid-template-columns: 1fr; }
	.ctor-panel__info { flex-direction: column; align-items: stretch; }
	.ctor-send .ctor-btn { width: 100%; }
	.ctor-modal { padding: 0; align-items: flex-end; }
	.ctor-modal__dlg { max-height: 92vh; border-radius: 10px 10px 0 0; padding: 18px 16px; }
	.ctor-modal__foot .ctor-btn { flex: 1; }
	.ctor-search { width: 100%; }
	.ctor-search input { flex: 1; width: auto; }
}

/* экран после отправки */
.ctor-thanks { text-align: center; padding: 36px 12px 20px; }
.ctor-thanks__text { font-size: 22px; line-height: 1.3; margin: 0 0 24px; }
