/* 3D конфигураторът — изгледът вляво (лепкав), изборът вдясно; на телефон изгледът е отгоре. */

.kf { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); align-items: start; border-bottom: 1px solid var(--rule); }
.kf-stage { position: sticky; top: var(--head-h); height: calc(100vh - var(--head-h)); min-height: 520px; border-right: 1px solid var(--rule); }
.kf-view { position: relative; width: 100%; height: 100%; background: #e3ded6; overflow: hidden; touch-action: none; }
.kf-view canvas { display: block; width: 100%; height: 100%; cursor: grab; outline: none; }
.kf-view.is-dragging canvas { cursor: grabbing; }
.kf-view canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.kf-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #e3ded6; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.kf-loading[hidden] { display: none; }
.kf-loading.is-error { text-transform: none; letter-spacing: 0; padding: 24px; text-align: center; }
.kf-cams { position: absolute; left: 20px; top: 20px; display: flex; gap: 0; background: rgba(255, 255, 255, .88); border: 1px solid var(--ink); }
.kf-cam { background: none; border: 0; padding: 9px 14px; font: 700 12px/1 var(--f-text); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); cursor: pointer; min-height: 40px; }
.kf-cam + .kf-cam { border-left: 1px solid var(--ink); }
.kf-cam[aria-pressed="true"] { background: var(--ink); color: #fff; }
.kf-hint { position: absolute; right: 20px; top: 20px; margin: 0; font-size: 12px; letter-spacing: .04em; color: var(--ink-2); background: rgba(255, 255, 255, .7); padding: 6px 10px; }
.kf-caption { position: absolute; left: 20px; bottom: 16px; margin: 0; max-width: calc(100% - 40px); text-align: left; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--ink); background: rgba(255, 255, 255, .82); padding: 6px 10px; }
.kf-caption:empty { display: none; }

.kf-panel { padding: clamp(28px, 3vw, 48px) clamp(20px, 2.6vw, 44px) 48px; }
.kf-head { padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.kf-title { font-family: var(--f-head); font-weight: 800; font-size: clamp(32px, 3.2vw, 52px); line-height: 1; text-transform: uppercase; letter-spacing: -.01em; }
.kf-title .h-sub { font-family: var(--f-display); font-weight: 400; font-size: .42em; margin-top: .3em; }
.kf-lead { margin: 16px 0 0; font-size: 16px; color: var(--ink-2); }

.kf-form { margin: 0; }
.kf-step { border: 0; margin: 0; padding: 22px 0 24px; border-bottom: 1px solid var(--hair); min-width: 0; }
.kf-step legend { display: flex; align-items: baseline; gap: 10px; float: left; width: 100%; margin: 0 0 14px; padding: 0; font: 700 15px/1.2 var(--f-text); text-transform: uppercase; letter-spacing: .03em; }
.kf-step legend span[lang] { font-weight: 400; color: var(--muted); font-size: 13px; }
.kf-step legend + * { clear: both; }
.kf-num { font-family: var(--f-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.kf-opt-input, .kf-sw-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

/* колекции */
.kf-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.kf-model { position: relative; display: flex; flex-direction: column; border: 1px solid var(--hair); cursor: pointer; background: #fff; transition: border-color .2s; }
.kf-model-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.kf-model span { font-family: var(--f-display); font-weight: 700; font-size: 13px; padding: 8px 10px; letter-spacing: .01em; }
.kf-opt-input:checked + .kf-model { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kf-opt-input:checked + .kf-model span { background: var(--ink); color: #fff; }
.kf-opt-input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ширини */
.kf-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); }
.kf-chip { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; cursor: pointer; font-size: 14px; min-height: 56px; }
.kf-chip b { font-family: var(--f-display); font-size: 20px; line-height: 1; }
.kf-chip small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kf-chip + .kf-opt-input + .kf-chip, .kf-chips .kf-chip:not(:first-of-type) { border-left: 1px solid var(--ink); }
.kf-opt-input:checked + .kf-chip { background: var(--ink); color: #fff; }
.kf-opt-input:checked + .kf-chip small { color: rgba(255, 255, 255, .7); }

/* цветове */
.kf-swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 6px; }
.kf-sw { display: flex; flex-direction: column; align-items: center; cursor: pointer; text-align: center; min-width: 0; }
.kf-sw-dot { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--hair); transition: box-shadow .15s; }
.kf-sw-name { margin-top: 5px; font-size: 10.5px; line-height: 1.15; text-transform: uppercase; }
.kf-sw-input:checked + .kf-sw .kf-sw-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.kf-sw-input:checked + .kf-sw .kf-sw-name { font-weight: 700; }
.kf-sw-input:focus-visible + .kf-sw .kf-sw-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink), 0 0 0 6px rgba(44, 41, 37, .25); }
.kf-picked { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
/* бленди: „като корпуса“ = мострата на корпуса с прекъснат кант (свързан цвят, не отделен избор) */
.kf-sw--same .kf-sw-dot { outline: 1px dashed var(--muted); outline-offset: 3px; }
.kf-sw-input:checked + .kf-sw--same .kf-sw-dot { outline-color: transparent; }

/* превключватели */
.kf-toggle { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; cursor: pointer; font-size: 15px; min-height: 36px; }
.kf-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.kf-toggle small { flex-basis: 100%; padding-left: 32px; font-size: 12px; color: var(--muted); }
.kf-toggle.is-disabled { opacity: .5; cursor: not-allowed; }

/* умивалници */
.kf-basins { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.kf-basin { display: flex; flex-direction: column; align-items: center; text-align: center; border: 1px solid var(--hair); padding: 8px 6px 10px; cursor: pointer; background: #fff; overflow: hidden; }
.kf-basin img { width: 100%; aspect-ratio: 1.4; object-fit: contain; transform: scale(1.3); }
.kf-basin b { font-family: var(--f-display); font-size: 13px; margin-top: 6px; }
.kf-basin small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.kf-opt-input:checked + .kf-basin { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kf-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.kf-sub { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--hair); }
.kf-sub[hidden] { display: none; }
.kf-sub-title { margin: 0 0 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kf-sub-title span[lang] { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* обобщение */
.kf-summary { margin-top: 28px; padding: 22px; background: var(--paper-2); border-top: 2px solid var(--ink); }
.kf-sum-title { font-family: var(--f-head); font-weight: 800; font-size: 18px; text-transform: uppercase; margin-bottom: 12px; }
.kf-sum-list li { display: grid; grid-template-columns: 118px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 14px; line-height: 1.4; }
.kf-sum-list li span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.kf-sum-list li b { font-weight: 700; }
.kf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.kf-actions .btn { min-height: 44px; padding: 0 16px; font-size: 13px; }
.kf-actions .btn--solid { flex: 1 1 100%; justify-content: space-between; }
.kf-fine { margin: 16px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

@media (max-width: 1023px) {
	.kf { grid-template-columns: 1fr; }
	.kf-stage { top: var(--head-h); height: 52vh; min-height: 300px; z-index: 5; border-right: 0; border-bottom: 1px solid var(--rule); }
	.kf-hint { display: none; }
	.kf-caption { left: 12px; right: auto; bottom: 10px; max-width: calc(100% - 24px); text-align: left; font-size: 12px; }
	.kf-cams { left: 12px; top: 12px; }
	.kf-cam { padding: 8px 10px; font-size: 11px; }
	.kf-panel { padding: 24px 16px 40px; }
}
@media (max-width: 480px) {
	/* по шкаф (28.09.2026): стъпката „Долен шкаф“ има три реда цветове — на телефон те са компактни, 6 в ред (2 реда
	   вместо 3), а моделите 3 в ред; името на избрания цвят е и отдолу („Избран: …“) */
	.kf-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 4px; }
	.kf-sw-dot { width: 42px; height: 42px; }
	.kf-sw-name { margin-top: 4px; font-size: 9.5px; letter-spacing: 0; }
	.kf-models { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.kf-model span { padding: 6px 7px; font-size: 12px; }
	.kf-sub { margin-top: 14px; padding-top: 12px; }
	.kf-sub-title { margin-bottom: 10px; }
	.kf-picked { margin-top: 8px; font-size: 13px; }
	.kf-sum-list li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 340px) { .kf-swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* долен шкаф: името + колекцията, от която е */
.kf-model span small { display: block; font-family: var(--f-text); font-weight: 400; font-size: 11px; letter-spacing: .04em; opacity: .75; margin-top: 2px; }
/* огледален шкаф и колона — карти с малка снимка; „от комплекта“ = както в каталога */
.kf-cards { display: grid; gap: 8px; }
.kf-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kf-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kf-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--hair); background: #fff; cursor: pointer; overflow: hidden; min-height: 100%; }
.kf-card-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.kf-cards--3 .kf-card-img { aspect-ratio: 3 / 4; object-position: 50% 30%; }
.kf-card-none { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--paper-2); font-size: 28px; color: var(--muted); }
.kf-cards--3 .kf-card-none { aspect-ratio: 3 / 4; }
.kf-card b { font-family: var(--f-display); font-size: 13px; padding: 8px 8px 0; }
.kf-card small { font-size: 11px; color: var(--muted); padding: 2px 8px 10px; line-height: 1.25; }
.kf-card .kf-pair { display: none; position: absolute; top: 6px; left: 6px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(255, 255, 255, .92); color: var(--ink); padding: 3px 6px; }
.kf-card.is-pair .kf-pair { display: block; }
.kf-opt-input:checked + .kf-card { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kf-opt-input:checked + .kf-card b { text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 480px) { .kf-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* баня — фонът зад комплекта; миниатюрите са 240 × 160 (ъгъл на стаята); „от каталога“ = банята на колекцията */
.kf-rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kf-room { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--hair); background: #fff; cursor: pointer; overflow: hidden; }
.kf-room-pic { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--paper-2); }
.kf-room-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kf-room b { font-family: var(--f-display); font-size: 13px; line-height: 1.2; padding: 8px 8px 0; }
.kf-room small { font-size: 11px; color: var(--muted); padding: 2px 8px 10px; line-height: 1.25; }
.kf-room .kf-pair { display: none; position: absolute; top: 6px; left: 6px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(255, 255, 255, .92); color: var(--ink); padding: 3px 6px; }
.kf-room.is-pair .kf-pair { display: block; }
.kf-opt-input:checked + .kf-room { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kf-opt-input:checked + .kf-room b { text-decoration: underline; text-underline-offset: .2em; }
/* докато снимките на банята се теглят: миниатюрата е приглушена, отдолу тече лента */
.kf-room.is-loading .kf-room-img { opacity: .6; }
.kf-room.is-loading .kf-room-pic::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background-color: rgba(44, 41, 37, .22); background-image: linear-gradient(90deg, var(--ink), var(--ink)); background-size: 35% 100%; background-repeat: no-repeat; animation: kf-room-load 1.1s ease-in-out infinite alternate; }
@keyframes kf-room-load { from { background-position: 0 0; } to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .kf-room.is-loading .kf-room-pic::after { animation: none; background-position: 50% 0; } }
@media (max-width: 340px) { .kf-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }