/* The door configurator — a wide working surface, not a form. */

/* Distinct from .cfg, which is the configurator grid itself — sharing the
   name made the BODY a grid and squeezed the site header into a column. */
body.cfg-page { background: #f4f1ec; }

.cfg-wide { max-width: 1500px; margin: 0 auto; padding: 0 20px 60px; }

/* ---------- browsing the range ---------- */
.cfg-browse-head { display: flex; justify-content: space-between; align-items: flex-end;
                   gap: 24px; flex-wrap: wrap; margin: 26px 0 18px; }
.cfg-browse-head h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.01em; }
.cfg-browse-head .lede { margin: 0; color: #6b635c; }
.cfg-search { display: flex; gap: 8px; }
.cfg-search input { min-width: 240px; }

.cfg-series { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { display: inline-block; padding: 7px 14px; border: 1px solid #ddd6ca; border-radius: 999px;
        background: #fff; color: #4a443f; text-decoration: none; font-size: 13px; }
.chip:hover { border-color: #8c6a3e; }
.chip.on { background: #231f20; border-color: #231f20; color: #fff; }

.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.cfg-card { display: block; background: #fff; border: 1px solid #e6e0d6; text-decoration: none;
            color: inherit; transition: border-color .15s, transform .15s; }
.cfg-card:hover { border-color: #8c6a3e; transform: translateY(-2px); }
.cfg-card-img { aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
                background: #faf8f5; overflow: hidden; }
.cfg-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cfg-noimg { color: #a89e93; font-size: 13px; }
.cfg-card-body { padding: 11px 13px 14px; }
.cfg-card-body strong { display: block; font-size: 14px; }
.cfg-card-body .hint { font-size: 12px; color: #8c6a3e; }
.cfg-card-body .tag { display: inline-block; margin-top: 6px; font-size: 11px; padding: 2px 7px;
                      background: #f0ebe2; color: #7a7068; border-radius: 3px; }

/* ---------- configuring one door: full window, icon rail, big preview ---------- */

body.k-body-page { margin: 0; background: #f2efea; overflow: hidden; }

.k { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.k-top { flex: 0 0 auto; display: flex; align-items: center; gap: 20px;
         background: #231f20; color: #f4f1ec; padding: 0 20px; height: 62px; }
.k-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.k-brand img { height: 22px; filter: invert(1) brightness(2); }
.k-brand span { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #b0a89e; }
.k-model { margin-left: auto; font-size: 19px; letter-spacing: .02em; }

.k-body { flex: 1 1 auto; display: grid; grid-template-columns: 108px 380px 1fr; min-height: 0; }

/* the rail */
.k-rail { background: #1c1a1a; overflow-y: auto; }
.k-rail button { display: flex; flex-direction: column; align-items: center; gap: 6px;
                 width: 100%; border: 0; background: none; color: #9c948b; cursor: pointer;
                 padding: 14px 6px; font: inherit; font-size: 10px; letter-spacing: .06em;
                 text-transform: uppercase; line-height: 1.25; text-align: center;
                 border-bottom: 1px solid #262323; }
.k-rail button svg { width: 22px; height: 22px; }
.k-rail button:hover { color: #fff; background: #262323; }
.k-rail button.on { color: #fff; background: #8c6a3e; }
.k-rail button.done::after { content: '✓'; position: absolute; }

/* the panel */
.k-panel { background: #fff; border-right: 1px solid #e2dbd0; display: flex; flex-direction: column; min-height: 0; }
.k-panel-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
                padding: 16px 18px; border-bottom: 1px solid #eee7dc; }
.k-panel-title { font-size: 17px; font-weight: 600; }
.k-close { border: 0; background: none; font-size: 26px; line-height: 1; color: #8a8179; cursor: pointer; }
.k-close:hover { color: #231f20; }
.k-panel-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 28px; }
.k.panel-shut .k-body { grid-template-columns: 108px 0 1fr; }
.k.panel-shut .k-panel { display: none; }

.k-blurb { margin: 0 0 14px; color: #6b635c; font-size: 13px; }
.k-empty { color: #8a8179; font-size: 13px; }

/* model browsing */
.k-materials { display: flex; gap: 8px; margin-bottom: 12px; }
.k-material { flex: 1; text-align: center; padding: 9px 8px; border: 1px solid #ddd6ca;
              border-radius: 3px; text-decoration: none; color: #4a443f; font-size: 12px; }
.k-material.on { background: #231f20; border-color: #231f20; color: #fff; }
.k-find { width: 100%; padding: 9px 11px; border: 1px solid #ddd6ca; font: inherit; font-size: 14px; margin-bottom: 14px; }
.k-models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.k-model-card { text-decoration: none; color: inherit; text-align: center; }
.k-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 3/4;
           background: #faf8f5; border: 1px solid #e6e0d6; overflow: hidden; }
.k-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.k-model-card.on .k-thumb { border-color: #8c6a3e; box-shadow: inset 0 0 0 1px #8c6a3e; }
.k-name { display: block; font-size: 11.5px; margin-top: 5px; line-height: 1.3; }

/* choices */
.k-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.k-opt { border: 1px solid #e0d9cd; background: #fff; padding: 10px 9px; cursor: pointer;
         font: inherit; font-size: 12.5px; line-height: 1.35; text-align: center; }
.k-opt:hover { border-color: #8c6a3e; }
.k-opt.on { border-color: #231f20; box-shadow: inset 0 0 0 1px #231f20; }
.k-opt img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 6px; }
.k-opt em { display: block; font-style: normal; color: #8c6a3e; font-size: 11px; margin-top: 3px; }

.k-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.k-swatch { border: 1px solid #e0d9cd; background: #fff; padding: 0; cursor: pointer; }
.k-swatch span { display: block; height: 46px; }
.k-swatch em { display: block; font-style: normal; font-size: 10.5px; padding: 4px 3px; line-height: 1.25; }
.k-swatch.on { outline: 2px solid #231f20; outline-offset: -2px; }

/* the stage */
.k-stage { position: relative; background: #fff; display: flex; align-items: center;
           justify-content: center; min-height: 0; overflow: hidden; }
.k-canvas { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 28px; }
.k-canvas img { max-width: 100%; max-height: 100%; object-fit: contain; }
.k-noimg { color: #a89e93; font-size: 14px; }
.k-loading { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
             background: rgba(255,255,255,.72); font-size: 13px; color: #6b635c; z-index: 3; }
.k-stage.busy .k-loading { display: flex; }

.k-views { position: absolute; top: 18px; left: 18px; z-index: 2; display: flex;
           background: #fff; border: 1px solid #e2dbd0; border-radius: 999px; padding: 3px; }
.k-views button { border: 0; background: none; padding: 7px 15px; border-radius: 999px;
                  font: inherit; font-size: 12.5px; cursor: pointer; color: #4a443f; }
.k-views button.on { background: #231f20; color: #fff; }
.k-views button:disabled { color: #bdb5ab; cursor: not-allowed; }

.k-full { position: absolute; top: 18px; right: 18px; z-index: 2; width: 40px; height: 40px;
          border: 1px solid #e2dbd0; background: #fff; border-radius: 4px; cursor: pointer;
          color: #4a443f; display: flex; align-items: center; justify-content: center; }
.k-full svg { width: 19px; height: 19px; }
.k-full:hover { border-color: #8c6a3e; color: #8c6a3e; }

.k-step { position: absolute; bottom: 18px; right: 18px; z-index: 2; display: flex;
          align-items: center; gap: 12px; font-size: 13px; color: #6b635c; }
.k-arrow { width: 38px; height: 38px; border: 1px solid #e2dbd0; border-radius: 50%; background: #fff;
           display: flex; align-items: center; justify-content: center; text-decoration: none;
           color: #231f20; font-size: 16px; }
.k-arrow:hover { border-color: #8c6a3e; }
.k-arrow.off { opacity: .35; pointer-events: none; }

.k-price { position: absolute; bottom: 18px; left: 18px; z-index: 2; }
.k-price strong { display: block; font-size: 22px; }
.k-price span { font-size: 11.5px; color: #6b635c; }

/* summary */
.k-summary { list-style: none; margin: 0 0 16px; padding: 0; }
.k-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
                border-bottom: 1px solid #f0ebe2; font-size: 13.5px; }
.k-summary li span { color: #6b635c; text-align: right; }
.k-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.k-row label, .k-fields label, .k-msg { display: block; font-size: 12px; color: #4a443f; }
.k-row input, .k-fields input, .k-fields select, .k-msg textarea {
  width: 100%; margin-top: 4px; padding: 8px 9px; border: 1px solid #ddd6ca; font: inherit; font-size: 13.5px; }
.k-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.k-saved { font-size: 12.5px; color: #6b635c; word-break: break-all; }
#k-enquiry { margin-top: 22px; border-top: 1px solid #eee7dc; padding-top: 18px; }
#k-enquiry h3 { margin: 0 0 10px; font-size: 15px; }
.k-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.k-fields i { color: #a3423c; font-style: normal; }
.k-msg { margin-top: 9px; }
.k-err { background: #f6e4e2; color: #7a2b26; padding: 10px 18px; font-size: 13.5px; }

@media (max-width: 1100px) {
  .k-body { grid-template-columns: 92px 300px 1fr; }
  .k-models { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  body.k-body-page { overflow: auto; }
  .k { height: auto; }
  .k-body { grid-template-columns: 1fr; }
  .k-rail { display: flex; overflow-x: auto; }
  .k-rail button { flex: 0 0 auto; width: auto; min-width: 88px; border-bottom: 0; border-right: 1px solid #262323; }
  .k-stage { order: -1; height: 58vh; border-bottom: 1px solid #e2dbd0; }
  .k-panel { border-right: 0; }
  .k-panel-body { max-height: none; }
}

/* visual choices — a door builder should be looked at, not read */
.k-opts-visual { grid-template-columns: repeat(2, 1fr); }
.k-opts-visual .k-opt { padding: 12px 8px 10px; }
.k-diagram { display: block; width: 100%; height: 74px; margin: 0 auto 8px; }
.k-diagram rect, .k-diagram path, .k-diagram circle { vector-effect: non-scaling-stroke; }
.k-opt.on .k-diagram rect[fill="#9a938a"] { fill: #8c6a3e; }

/* Way out to the full gallery from the model panel. */
.k-all{display:block;margin:2px 0 10px;font-size:12px;letter-spacing:.02em;
  color:var(--k-dim,#9a9490);text-decoration:none;border-bottom:1px solid transparent;
  width:max-content;padding-bottom:1px}
.k-all:hover{color:var(--k-ink,#e8e4df);border-bottom-color:currentColor}
