/* Chaprika – jozve order form. Mobile first; two columns from 900px. */

.chpj {
	--chpj-accent: #00AEEF;
	--chpj-accent-ink: #00597D;
	--chpj-btn: #00648F;
	--chpj-btn-hover: #004E70;
	--chpj-tint: #EAF7FD;
	--chpj-ground: #F2F5F8;
	--chpj-field: #F3F6F8;
	--chpj-card: #FFFFFF;
	--chpj-ink: #0F1E2A;
	--chpj-ink-2: #26343F;
	--chpj-muted: #556673;
	--chpj-line: #E3E9ED;
	--chpj-warn: #B4441B;
	--chpj-ok: #0B7A4B;
	font-family: inherit;
	color: var(--chpj-ink);
	background: var(--chpj-ground);
	border-radius: 20px;
	padding: 16px;
	box-sizing: border-box;
	direction: rtl;
	text-align: right;
	line-height: 1.6;
}
.chpj *, .chpj *::before, .chpj *::after { box-sizing: border-box; }
.chpj [hidden] { display: none !important; }

/* Reset theme button styling inside the form. */
.chpj button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.4;
	box-shadow: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.chpj button:focus-visible, .chpj input:focus-visible, .chpj a:focus-visible, .chpj .chpj-drop:focus-within {
	outline: 2px solid var(--chpj-accent);
	outline-offset: 2px;
}

.chpj-grid { display: flex; flex-direction: column; gap: 14px; }
.chpj-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.chpj-card {
	background: var(--chpj-card);
	border-radius: 18px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	box-shadow: 0 1px 2px rgba(15, 30, 42, .06);
}
.chpj-h { margin: 0; font-size: 15px; font-weight: 800; color: var(--chpj-ink); }

/* Steppers */
.chpj-steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chpj-stepper { background: var(--chpj-field); border-radius: 14px; padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.chpj-stepper label { font-size: 12.5px; font-weight: 600; color: var(--chpj-muted); margin: 0; }
.chpj-stepper-row { display: flex; align-items: center; gap: 6px; }
.chpj .chpj-step {
	width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: none; padding: 0;
	background: #fff; color: var(--chpj-btn);
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 1px 2px rgba(15, 30, 42, .08);
}
.chpj .chpj-step:hover { background: var(--chpj-tint); }
.chpj .chpj-num {
	width: 100%; min-width: 0; border: none !important; background: transparent !important; box-shadow: none !important;
	text-align: center; font: inherit; font-size: 20px; font-weight: 800; color: var(--chpj-ink); padding: 0; margin: 0; height: 44px;
}
.chpj .chpj-num::placeholder { color: #A9B4BC; }
.chpj-warn { margin: -4px 4px 0; font-size: 12.5px; color: var(--chpj-warn); display: none; }
.chpj.is-invalid .chpj-warn { display: block; }

/* Option groups */
.chpj-group { display: flex; flex-direction: column; gap: 6px; }
.chpj-group-row { display: flex; align-items: center; gap: 8px; }
.chpj-group-label { width: 86px; flex: 0 0 86px; display: flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 700; color: var(--chpj-ink-2); }
.chpj .chpj-info {
	width: 30px; height: 30px; flex: 0 0 30px; border: none; background: transparent; color: #6E7E8A; padding: 0;
	display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.chpj .chpj-info:hover, .chpj .chpj-info[aria-expanded="true"] { color: var(--chpj-btn); background: var(--chpj-tint); }
.chpj-seg { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; background: var(--chpj-field); padding: 4px; border-radius: 13px; }
.chpj .chpj-opt {
	flex: 1 1 0; min-width: 0; min-height: 44px; border-radius: 10px; padding: 4px 2px;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
	background: transparent; border: 1.5px solid transparent; color: var(--chpj-ink-2); font-size: 14px; font-weight: 500;
	transition: background .15s, color .15s, border-color .15s;
}
.chpj .chpj-opt:hover { background: rgba(255, 255, 255, .6); }
.chpj .chpj-opt[aria-pressed="true"] {
	background: #fff; border-color: var(--chpj-accent); color: var(--chpj-accent-ink); font-weight: 800;
	box-shadow: 0 1px 3px rgba(0, 120, 170, .18);
}
.chpj-opt-main { display: flex; align-items: center; gap: 6px; }
.chpj-opt-sub { font-size: 11px; font-weight: 500; color: #5E6E7A; }
.chpj-swatch { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: 0 0 11px; }
.chpj-swatch--bw { background: linear-gradient(90deg, #1B2730 50%, #D9DEE2 50%); }
.chpj-cov { width: 11px; height: 14px; flex: 0 0 11px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; overflow: hidden; display: inline-block; opacity: .85; }
.chpj-cov > span { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, #00AEEF, #E6007E); }
.chpj-cov--low > span { height: 22%; }
.chpj-cov--mid > span { height: 55%; }
.chpj-cov--high > span { height: 100%; }
.chpj-swatch--color { background: conic-gradient(#00AEEF 0 33%, #E6007E 0 66%, #FFD400 0); }
.chpj-hint { margin: 0 94px 0 0; font-size: 12.5px; line-height: 1.8; color: #3E5260; background: #EEF8FC; border-radius: 10px; padding: 8px 12px; }

/* Binding tiles */
.chpj-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chpj .chpj-tile {
	min-height: 66px; border-radius: 14px; padding: 10px 12px; text-align: right;
	display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 3px;
	background: var(--chpj-field); border: 1.5px solid transparent; color: var(--chpj-ink);
}
.chpj .chpj-tile[aria-pressed="true"] { background: var(--chpj-tint); border-color: var(--chpj-accent); }
.chpj-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.chpj-tile-title { font-size: 13.5px; font-weight: 700; }
.chpj-tile-check { color: #0089BF; display: none; }
.chpj-tile[aria-pressed="true"] .chpj-tile-check { display: inline-flex; }
.chpj-tile-price { font-size: 12.5px; color: var(--chpj-muted); }

.chpj .chpj-switch-row {
	min-height: 58px; border: none; border-radius: 14px; background: var(--chpj-field); padding: 8px 14px;
	display: flex; align-items: center; gap: 12px; text-align: right; color: var(--chpj-ink); width: 100%;
}
.chpj-switch-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.chpj-switch-title { font-size: 14px; font-weight: 700; }
.chpj-switch-sub { font-size: 12.5px; color: var(--chpj-muted); }
.chpj-switch { width: 48px; height: 28px; flex: 0 0 48px; border-radius: 14px; background: #C3CDD4; position: relative; transition: background .15s; }
.chpj-knob { position: absolute; top: 3px; left: 23px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
.chpj-switch-row[aria-pressed="true"] .chpj-switch { background: var(--chpj-accent); }
.chpj-switch-row[aria-pressed="true"] .chpj-knob { left: 3px; }

/* Upload */
.chpj-drop {
	position: relative; min-height: 104px; border: 1.5px dashed #8FCFEA; border-radius: 14px; background: #F4FBFE;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	color: var(--chpj-btn); padding: 14px; cursor: pointer; text-align: center; margin: 0;
}
.chpj-drop.is-over { background: var(--chpj-tint); border-color: var(--chpj-accent); }
.chpj-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.chpj-drop-title { font-size: 14px; font-weight: 700; }
.chpj-drop-sub { font-size: 12px; color: var(--chpj-muted); }
.chpj-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chpj-files:empty { display: none; }
.chpj-file { display: flex; align-items: center; gap: 10px; background: var(--chpj-field); border-radius: 12px; padding: 10px 12px; margin: 0; }
.chpj-file-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: #fff; color: #C2410C; display: flex; align-items: center; justify-content: center; }
.chpj-file.is-done .chpj-file-icon { color: var(--chpj-ok); }
.chpj-file.is-error .chpj-file-icon { color: var(--chpj-warn); }
.chpj-file-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.chpj-file-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.chpj-file-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: right; }
.chpj-file-state { color: var(--chpj-muted); flex: 0 0 auto; }
.chpj-file.is-done .chpj-file-state { color: var(--chpj-ok); }
.chpj-file.is-error .chpj-file-state { color: var(--chpj-warn); white-space: normal; }
.chpj-progress { height: 5px; border-radius: 3px; background: #DDE5EA; overflow: hidden; }
.chpj-progress > span { display: block; height: 100%; width: 0; background: var(--chpj-accent); border-radius: 3px; transition: width .2s; }
.chpj-file.is-done .chpj-progress, .chpj-file.is-error .chpj-progress { display: none; }
.chpj-file.is-error .chpj-file-top { flex-direction: column; gap: 2px; }
.chpj .chpj-file-x {
	width: 36px; height: 36px; flex: 0 0 36px; border: none; background: transparent; color: #6E7E8A; border-radius: 10px; padding: 0;
	display: flex; align-items: center; justify-content: center;
}
.chpj .chpj-file-x:hover { background: #fff; color: var(--chpj-warn); }
.chpj .chpj-file-retry { border: none; background: #fff; color: var(--chpj-btn); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 700; }

.chpj-guest { display: flex; align-items: center; gap: 12px; background: #F4FBFE; border: 1.5px solid #CDEBF7; border-radius: 14px; padding: 12px 14px; flex-wrap: wrap; }
.chpj-guest-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: #fff; color: var(--chpj-btn); display: flex; align-items: center; justify-content: center; }
.chpj-guest-text { flex: 1 1 200px; font-size: 13px; line-height: 1.8; color: var(--chpj-ink-2); }

/* Buttons */
.chpj .chpj-btn, .chpj a.chpj-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 16px; border: none; border-radius: 12px;
	background: var(--chpj-btn); color: #fff !important; font-size: 14px; font-weight: 800; text-decoration: none;
}
.chpj .chpj-btn:hover { background: var(--chpj-btn-hover); }
.chpj .chpj-btn[disabled], .chpj .chpj-btn.is-busy { opacity: .6; cursor: progress; }
.chpj .chpj-btn--cta { width: 100%; min-height: 54px; font-size: 15.5px; border-radius: 14px; }
.chpj .chpj-btn--bar { min-height: 52px; padding: 0 18px; border-radius: 14px; flex: 0 0 auto; }

.chpj-msg { margin: 0; font-size: 13px; line-height: 1.7; color: var(--chpj-warn); }
.chpj-msg:empty { display: none; }
.chpj-msg.is-ok { color: var(--chpj-ok); }
.chpj-msg a { color: var(--chpj-btn); font-weight: 700; }

/* Price lines */
.chpj-lines { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #3E5260; }
.chpj-line { display: flex; justify-content: space-between; gap: 8px; }
.chpj-line--unit { font-weight: 700; color: var(--chpj-ink); border-top: 1px dashed #CBD5DC; padding-top: 7px; }
.chpj-line--disc { color: var(--chpj-ok); font-weight: 700; }
.chpj-deal { margin: -4px 0 0; font-size: 12.5px; font-weight: 700; color: var(--chpj-ok); background: #E8F6EF; border-radius: 10px; padding: 7px 12px; }

/* Desktop preview column (hidden on phones) */
.chpj-side { display: none; }
.chpj-preview { background: #EAF2F6; padding: 26px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chpj-stage { height: 290px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 24px; }
.chpj-book { position: relative; flex: 0 0 auto; transition: width .25s, height .25s; }
.chpj-stack > span { position: absolute; background: #fff; border: 1px solid #D3DBE1; border-radius: 3px; }
.chpj-front {
	position: absolute; inset: 0; border-radius: 3px; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 10px 24px rgba(15, 30, 42, .16); background: #fff; border: 1px solid #D3DBE1;
}
.chpj-cover-art { display: none; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.chpj-cover-title { font-size: 22px; font-weight: 800; }
.chpj-cover-line { width: 44px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .75); }
.chpj-cover-brand { font-size: 11px; font-weight: 700; opacity: .9; }
.chpj-book.has-cover .chpj-front { background: #0089BF; border-color: #0089BF; }
.chpj-book.has-cover .chpj-cover-art { display: flex; }
.chpj-book.has-cover .chpj-front .chpj-page-art { display: none; }
.chpj-page-art { display: flex; flex-direction: column; gap: 6px; width: 72%; }
.chpj-l { display: block; height: 4px; border-radius: 2px; background: #C7CFD5; }
.chpj-l--title { height: 7px; width: 58%; background: #8D99A2; }
.chpj-l--short { width: 75%; }
.chpj-img { display: block; height: 32px; border-radius: 3px; background: linear-gradient(135deg, #5D6973 0 40%, #A9B3BA 40% 65%, #7F8A93 65%); }
.chpj.cov-low .chpj-img { height: 10px; }
.chpj.cov-high .chpj-img { height: 58px; }
.chpj.is-color .chpj-img { background: linear-gradient(135deg, #00AEEF 0 40%, #FFD400 40% 65%, #E6007E 65%); }
.chpj-plastic { position: absolute; inset: -3px; border-radius: 4px; background: rgba(255, 255, 255, .18); border: 1.5px solid rgba(120, 180, 205, .55); display: none; }
.chpj-book.is-spiral .chpj-plastic { display: block; }
.chpj-book.is-thick .chpj-plastic { border-width: 3px; border-color: rgba(120, 180, 205, .8); }
.chpj-rings > span { position: absolute; right: -7px; width: 14px; height: 6px; border: 2px solid #34414B; border-radius: 4px; }
.chpj-staples > span { position: absolute; width: 3px; height: 18px; border-radius: 2px; background: #6B7680; }
.chpj-sample {
	position: relative; flex: 0 0 auto; background: #fff; border-radius: 3px; box-shadow: 0 8px 18px rgba(15, 30, 42, .14);
	display: flex; align-items: center; justify-content: center; transform: rotate(-4deg); transition: width .25s, height .25s;
}
.chpj-sample .chpj-page-art { width: 74%; }
.chpj-gloss { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(118deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .75) 48%, rgba(255, 255, 255, 0) 58%); display: none; }
.chpj.is-glossy .chpj-gloss { display: block; }
.chpj-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chpj-chips span { font-size: 12px; font-weight: 700; color: var(--chpj-ink-2); background: #fff; border-radius: 999px; padding: 4px 11px; }
.chpj-preview-note { margin: 0; font-size: 11.5px; color: var(--chpj-muted); }
.chpj-summary { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.chpj-total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px solid var(--chpj-line); padding-top: 14px; }
.chpj-total-row span { font-size: 14px; font-weight: 700; color: var(--chpj-ink-2); }
.chpj-total-row strong { font-size: 25px; font-weight: 800; color: var(--chpj-ink); }

/* Phone price bar: sticks to the bottom while the form is on screen. */
.chpj-bar {
	position: sticky; bottom: var(--chpj-bar-offset, 0px); z-index: 30;
	margin: 14px -16px -16px; background: #fff; border-radius: 22px 22px 0 0;
	box-shadow: 0 -6px 24px rgba(15, 30, 42, .10);
	padding: 8px 16px calc(14px + env(safe-area-inset-bottom, 0px));
	display: flex; flex-direction: column; gap: 8px;
}
.chpj .chpj-details-toggle {
	align-self: center; min-height: 32px; border: none; background: transparent; color: var(--chpj-muted); font-size: 12.5px;
	display: inline-flex; align-items: center; gap: 4px; padding: 0 10px;
}
.chpj-details-toggle svg { transform: rotate(180deg); transition: transform .15s; }
.chpj-details-toggle[aria-expanded="true"] svg { transform: none; }
.chpj-lines--bar { background: #F6F8FA; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; }
.chpj-bar-row { display: flex; align-items: center; gap: 12px; }
.chpj-bar-price { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chpj-bar-sum { font-size: 11.5px; color: var(--chpj-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chpj-bar-total { font-size: 21px; font-weight: 800; color: var(--chpj-ink); white-space: nowrap; }

@media (max-width: 559px) {
	.chpj-group[data-group="coverage"] .chpj-group-row { flex-direction: column; align-items: stretch; gap: 6px; }
	.chpj-group[data-group="coverage"] .chpj-group-label { width: auto; flex-basis: auto; }
	.chpj-group[data-group="coverage"] .chpj-hint { margin-right: 0; }
	.chpj .chpj-step { width: 40px; height: 40px; flex-basis: 40px; }
	.chpj .chpj-num { font-size: 19px; }
}

@media (min-width: 560px) {
	.chpj-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
	.chpj { padding: 24px; }
	.chpj-grid { flex-direction: row; align-items: flex-start; gap: 24px; }
	.chpj-main { flex: 1 1 auto; gap: 18px; }
	.chpj-card { padding: 22px 24px; gap: 18px; }
	.chpj-group-label { width: 110px; flex-basis: 110px; font-size: 14px; }
	.chpj-hint { margin-right: 118px; }
	.chpj-opt { flex-direction: row !important; gap: 7px !important; }
	.chpj-side {
		display: flex; flex-direction: column; flex: 0 0 380px; width: 380px;
		background: var(--chpj-card); border-radius: 20px; overflow: hidden;
		box-shadow: 0 1px 2px rgba(15, 30, 42, .06);
		position: sticky; top: 24px;
	}
	.chpj-bar { display: none; }
}

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