.shading-preview {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #e8e3db;
  border-radius: 1rem;
  background: #fffdfa;
  color: #29261f;
}

.shading-preview__scene {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 1.25;
  max-height: 21rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 4%, #fffaf2, transparent 65%),
    linear-gradient(143deg, #ede3d6 10%, #e5d7c7 65%, #d5c4b0);
}

.shading-preview__scene::before {
  position: absolute;
  inset: 57% -8% -30% 15%;
  background: linear-gradient(163deg, transparent 42%, #fff7ec8c 42%, #fff7ec26 76%, transparent 76%);
  filter: blur(4px);
  transform: skewX(-22deg);
  content: "";
}

.shading-preview__window {
  --shade-reveal: clamp(5px, 1.65vw, 10px);
  position: relative;
  box-sizing: border-box;
  width: min(74%, calc(var(--shade-ratio, .8) * min(61cqw, 16.3rem)));
  aspect-ratio: var(--shade-ratio, .8);
  border: 1px solid #fdf9f2;
  border-bottom-color: #b6a596;
  border-radius: 2px;
  background: linear-gradient(143deg, #fffdf7 8%, #e9e1d5 57%, #f8f3ec 96%);
  box-shadow: -1px -1px #e2d8cb, 8px 11px 12px #4b392345, 20px 29px 22px #53412827;
}

.shading-preview__window::after {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  right: -5%;
  bottom: -5px;
  left: -5%;
  height: 6px;
  border-top: 1px solid #fffdf7;
  border-radius: 1px;
  background: linear-gradient(#f8f2e9, #d6c8b7);
  box-shadow: 0 3px 6px #63503c50;
  content: "";
}

.shading-preview__glass {
  position: absolute;
  inset: var(--shade-reveal);
  overflow: hidden;
  border: 1px solid #93877c;
  border-top-color: #6f645b;
  background: #c1c9a5 url("preview/garden.webp") 44% center / cover no-repeat;
  box-shadow: inset 2px 4px 5px #392c235e;
}

.measure-line {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: .68rem;
  line-height: 1.2;
  font-weight: 650;
  color: #493e32;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.measure-line span { padding: 1px 4px; background: #efe7db; border-radius: 3px; white-space: nowrap; }
.measure-width {
  left: 0; right: 0; bottom: calc(100% + 9px); height: 7px;
  border-inline: 1px solid #766957;
  background: linear-gradient(#918472, #918472) center / 100% 1px no-repeat;
}
.measure-height {
  top: 0; bottom: 0; left: calc(100% + 10px); width: 7px;
  border-block: 1px solid #766957;
  background: linear-gradient(#918472, #918472) center / 1px 100% no-repeat;
}
.measure-width span, .measure-height span { position: absolute; }
.measure-height span { writing-mode: vertical-rl; padding: 4px 1px; }

.shading-preview__glass::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(135deg, #f8fbff16, transparent 67%);
  pointer-events: none;
  content: "";
}

.shading-preview__shade {
  position: absolute;
  inset: 0 0 16%;
}

.shading-preview__material {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shading-preview__head,
.shading-preview__rail {
  position: absolute;
  right: 0;
  left: 0;
  border: 1px solid #30252140;
  border-radius: 1px;
  background:
    linear-gradient(180deg, #fff6 0%, transparent 21% 69%, #3b292b44 100%),
    var(--shade-frame-texture, none) center / 86px auto,
    var(--shade-frame);
  box-shadow: 0 2px 3px #382c255c;
}

.shading-preview__head { top: 0; height: 10px; }
.shading-preview__rail { bottom: 0; height: 6px; }

/* The frame fills the interactive surface first. The material covers its centre,
   leaving the exposed rails (or all four mesh edges) independently selectable. */
.js .part-hit {
  display: block;
  position: absolute;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #302b24;
  cursor: pointer;
}
.part-frame { inset: 0; }
.part-material { inset: 16px 0 12px; }
.shading-preview[data-type="site"] .part-frame { inset: -5px; }
.shading-preview[data-type="site"] .shading-preview__glass { overflow: visible; }
.shading-preview[data-type="site"] .part-frame::before {
  content: "";
  position: absolute;
  inset: calc(0px - var(--shade-reveal));
}
.shading-preview[data-type="site"] .part-material { inset: 8px; }
.part-pin {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 3px;
  border-radius: 20px;
  background: #fffefa;
  box-shadow: 0 0 0 1px #45382e5c, 0 1px 5px #28201945;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
}
.part-pin b { display: grid; width: 23px; height: 23px; place-items: center; font-size: 17px; font-weight: 550; }
.part-pin > span { padding-right: 8px; }
.part-frame .part-pin { left: 6%; top: 1px; }
.part-hit:is(:hover,:focus-visible) .part-pin { color: var(--accent); }
.part-hit:focus-visible { outline-offset: -2px; }
.part-material:is(:hover,:focus-visible) { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px #fff; }
.part-frame:is(:hover,:focus-visible) { box-shadow: inset 0 3px var(--accent), inset 0 -3px var(--accent); }
.shading-preview[data-type="site"] .part-frame:is(:hover,:focus-visible) { box-shadow: inset 0 0 0 3px var(--accent); }

.shading-preview[data-type="zaluzie"] .shading-preview__material {
  inset: 8px 0 4px;
  background:
    linear-gradient(90deg, #372c232b, #fff1 23%, transparent 72%, #382a1f29),
    repeating-linear-gradient(to bottom, #fff5 0 1px, transparent 2px 6px, #34252238 7px, #38271d75 8px, transparent 8px 10px),
    repeating-linear-gradient(to bottom, var(--shade-color) 0 8px, transparent 8px 10px);
}

.shading-preview[data-type="zaluzie"] .shading-preview__material::before {
  position: absolute;
  z-index: 1;
  inset: 0 22%;
  border-inline: 1px solid #76685980;
  content: "";
}

.shading-preview[data-type="zaluzie"][data-textured] .shading-preview__material::after {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, #fff4 0 1px, transparent 2px 5px, #34252254 7px 8px, transparent 8px 10px),
    var(--shade-texture) center / 120px 42px;
  mask-image: repeating-linear-gradient(to bottom, #000 0 8px, transparent 8px 10px);
  content: "";
}

.shading-preview[data-type="rolety"] .shading-preview__shade { bottom: 27%; }
.shading-preview[data-type="rolety"] .shading-preview__head { height: 13px; border-radius: 6px; }
.shading-preview[data-type="rolety"] .shading-preview__material {
  inset: 5px 2px 2px;
  background:
    linear-gradient(112deg, #fff2, transparent 63%, #36232320),
    repeating-linear-gradient(0deg, #fff2 0 1px, #3023230d 1px 2px, transparent 2px 3px),
    repeating-linear-gradient(90deg, #2d251813 0 1px, transparent 1px 3px),
    var(--shade-color);
}

.shading-preview[data-type="site"] .shading-preview__shade {
  inset: 0;
  border: 5px solid var(--shade-frame);
  border-image: var(--shade-frame-texture, none) 7 / 5px / 0 stretch;
  box-shadow: inset 0 0 0 1px #24201f60, inset 0 2px 6px #231e2660;
}

.shading-preview[data-type="site"] .shading-preview__material {
  opacity: .73;
  background:
    repeating-linear-gradient(0deg, var(--shade-color) 0 .8px, transparent .8px 2px),
    repeating-linear-gradient(90deg, var(--shade-color) 0 .8px, transparent .8px 2px);
}

.shading-preview[data-type="site"] :is(.shading-preview__head, .shading-preview__rail) { display: none; }
.shading-preview[data-type="plise"] .shading-preview__shade { top: 10%; bottom: 14%; }
.shading-preview[data-type="plise"] .shading-preview__head { height: 6px; }
.shading-preview[data-type="plise"] .shading-preview__material {
  inset: 3px 1px;
  background:
    linear-gradient(90deg, #3a261d39, #fff1 30%, transparent 80%, #3a261d23),
    repeating-linear-gradient(180deg, #fff7 0, #fff1 3px, transparent 5px, #35202c46 6px, #40272375 8px, #fff7 9px),
    repeating-linear-gradient(90deg, #fff2 0 1px, transparent 1px 3px),
    var(--shade-color);
}

.shading-preview__caption {
  padding: .9rem 1rem 1rem;
}

.shading-preview__product {
  margin-bottom: .3rem;
  color: #62574c;
  font-size: .76rem;
  font-weight: 600;
}

.shading-preview__status {
  display: grid;
  gap: .2rem;
  overflow-wrap: anywhere;
}

.shading-preview__title { font-size: 1rem; }
.shading-preview__frame-label { color: #62574c; font-size: .82rem; }
.shading-preview__note.shading-preview__note {
  margin: .6rem 0 0;
  color: #62574c;
  font-size: .77rem;
  line-height: 1.43;
}
