/* L4: product viewer and breadcrumb below the shared customer header. */
.layout-refrigerator {
  display: grid;
  --refrigerator-scene-height: var(--refrigerator-family-scene-height);
  grid-template-rows: max-content var(--refrigerator-scene-height);
}

.layout-refrigerator > .ui-breadcrumb {
  padding: var(--space-sm) var(--space-2xl);
}

.layout-refrigerator--viewer {
  --refrigerator-scene-height: clamp(var(--refrigerator-scene-min), calc(100dvh - var(--lab-helper-height)), var(--refrigerator-scene-max));
  grid-template-rows: var(--refrigerator-scene-height);
}

.layout-refrigerator-card-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--lab-card-photo);
}

/* L2 model selection card, shared by the viewer and its catalog preview. */
.ui-refrigerator-model {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  height: var(--viewer-card-height, 174px);
  position: relative;
  overflow: hidden;
  border-radius: var(--product-card-radius);
  background: var(--lab-card-surface);
  box-shadow: var(--lab-card-shadow);
  color: var(--lab-card-ink);
}
.ui-refrigerator-model__select {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: normal;
  text-align: left;
  cursor: pointer;
}
.ui-refrigerator-model__select:focus-visible { outline-offset: -3px; }
.ui-refrigerator-model:has(.ui-refrigerator-model__select[aria-pressed="true"]) { background: var(--lab-card-selected); }
.ui-refrigerator-model:has(.ui-refrigerator-model__select[aria-pressed="true"])::after {
  position: absolute;
  inset: 0;
  border: 1px solid var(--lab-card-accent);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}
.ui-refrigerator-model__check {
  display: none;
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lab-card-accent);
  color: #fff;
}
.ui-refrigerator-model__select[aria-pressed="true"] .ui-refrigerator-model__check { display: grid; }
.ui-refrigerator-model__check .icon { width: 13px; height: 13px; }
.ui-refrigerator-model__photo {
  --thumb-product-height: calc((100% - 14px) * var(--model-height-scale));
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--lab-card-photo);
}
.ui-refrigerator-model__photo::after {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 48%;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #2b404b56;
  filter: blur(2px);
  content: "";
}
.ui-refrigerator-model__photo img {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: calc(8px - var(--thumb-product-height) * var(--foot));
  height: calc(var(--thumb-product-height) * var(--height));
  width: auto;
  aspect-ratio: var(--photo-ratio);
  object-fit: fill;
  transform: translateX(calc(-50% + var(--shift)));
}
.ui-refrigerator-model__caption { display: grid; gap: 2px; padding: 6px 8px 4px; }
.ui-refrigerator-model__summary { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.ui-refrigerator-model strong { font-size: clamp(.875rem, 1.23cqw, 1.0625rem); font-weight: 740; letter-spacing: -.025em; }
.ui-refrigerator-model small { color: var(--lab-card-muted); font-size: .75rem; font-weight: 560; white-space: nowrap; }
.ui-refrigerator-model__code { letter-spacing: .01em; }
.ui-refrigerator-model .ui-product-card__actions { gap: var(--space-xs); padding: 0 var(--space-sm) var(--space-sm); }
.ui-refrigerator-model .ui-product-card__actions .ui-button {
  min-height: var(--control-xs);
  height: var(--control-xs);
  padding: 0 var(--space-xs);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.layout-refrigerator-detail { padding: var(--space-xl) var(--space-2xl); }
.section-refrigerator-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-2xl);
  margin-top: var(--space-lg);
}
.section-refrigerator-detail__photo {
  display: grid;
  place-items: center;
  min-height: 440px;
  padding: var(--space-xl);
  border-radius: var(--product-card-radius);
  background: var(--product-card-photo-surface);
}
.section-refrigerator-detail__photo img { max-height: 400px; width: 100%; object-fit: contain; }

/* L3 central viewer and surrounding controls. */
.section-refrigerator .refrigerator-back {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: clamp(12px, 1.5cqw, 22px);
  color: var(--lab-card-ink);
}

.section-refrigerator :where(button:not(.ui-button)) { font: inherit; color: inherit; cursor: pointer; }

.section-refrigerator :focus-visible {
  outline: 2px solid var(--lab-card-accent);
  outline-offset: 3px;
}

.section-refrigerator {
  --muted: var(--lab-card-muted);
  --surface: var(--lab-card-surface);
  --accent: var(--lab-card-accent);
  --radius: var(--lab-card-radius);
  --text-note: .8125rem;
  --text-ui: .9375rem;
  --text-body: 1rem;
  --text-section: var(--text-lg);
  --text-title: clamp(1.875rem, 3.12cqw, 2.75rem);
  color: var(--lab-card-ink);
  line-height: normal;
  --edge: clamp(24px, 3cqw, 44px);
  --rail-width: 52px;
  --rail-gap: 10px;
  --info-panel-height: 384px;
  --info-icon-size: 22px;
  --pivot: 50%;
  --camera-height: 52%;
  --camera-zoom: 1.3;
  --room-reference-zoom: .8;
  --floor: 23%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: size;
  background: var(--refrigerator-room-surface);
}
.section-refrigerator .camera {
  --product-height: calc(min(58cqh, 38cqw) * var(--model-height-scale, 1));
  --body-width: calc(var(--product-height) * var(--body-ratio, .47));
}
.section-refrigerator .camera, .section-refrigerator .room-world {
  position: absolute;
  inset: 0;
  transform: translateY(var(--camera-pan, 0px)) scale(var(--camera-zoom));
  transform-origin: var(--pivot) var(--camera-height);
  transition: transform 250ms cubic-bezier(.25, 1, .5, 1);
  pointer-events: none;
}
.section-refrigerator .room-world { transform: translateY(var(--camera-pan, 0px)) scale(calc(var(--camera-zoom) * 1.14)); }
.section-refrigerator .scene-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--refrigerator-room-light);
}
.section-refrigerator .room {
  /* The extra image area lets the room fill the frame during camera scaling. */
  --overscan: calc(1 / var(--room-reference-zoom) - 1);
  position: absolute;
  top: calc(-1 * var(--camera-height) * var(--overscan) - 1px);
  right: calc((var(--pivot) - 100%) * var(--overscan) - 1px);
  bottom: calc((var(--camera-height) - 100%) * var(--overscan) - 1px);
  left: calc(-1 * var(--pivot) * var(--overscan) - 1px);
  background: var(--refrigerator-room-surface) var(--refrigerator-room-image) center / cover no-repeat;
  filter: var(--refrigerator-room-tone);
}
.section-refrigerator .product-art, .section-refrigerator .shadow, .section-refrigerator .turntable-base { position: absolute; left: var(--pivot); }
.section-refrigerator .product-art {
  bottom: calc(var(--floor) - var(--product-height) * var(--foot));
  height: calc(var(--product-height) * var(--height));
  aspect-ratio: var(--photo-ratio);
  transform: translateX(calc(-50% + var(--shift)));
}
.section-refrigerator .machine { display: block; position: relative; width: 100%; height: 100%; }
.section-refrigerator .wheel-contacts { position: absolute; inset: 0; }
.section-refrigerator .wheel-contacts i {
  position: absolute;
  width: 18px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -38%);
  background: #20323e85;
  filter: blur(2px);
}
.section-refrigerator .turntable-base {
  bottom: calc(var(--floor) - 16px);
  width: clamp(172px, calc(var(--body-width) * 1.45), 432px);
  height: clamp(46px, 8.5cqh, 66px);
  transform: translateX(-50%);
  border: 1px solid #f9fbf8;
  border-radius: 50%;
  background: linear-gradient(#f8faf7, #dfe5df);
  box-shadow: 0 3px 0 -1px #aeb7ae, 0 9px 15px -5px #2c3f3654;
}
.section-refrigerator .shadow {
  bottom: calc(var(--floor) - 3px);
  width: clamp(110px, calc(var(--body-width) * .97), 330px);
  height: 14px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #24353e35;
  filter: blur(5px);
}
.section-refrigerator .turntable {
  position: absolute;
  z-index: 1;
  inset: 0;
  touch-action: pan-y;
  user-select: none;
}
.section-refrigerator[data-spin="true"][data-door="closed"] .turntable,
.section-refrigerator[data-pannable="true"] .turntable { cursor: grab; }
.section-refrigerator[data-pannable="true"] .turntable { touch-action: none; }
.section-refrigerator .turntable.dragging { cursor: grabbing; }
.section-refrigerator .turntable.is-panning .camera, .section-refrigerator .turntable.is-panning .room-world { transition: none; }
.section-refrigerator .turntable:focus-visible { outline-offset: -5px; }
.section-refrigerator .viewer-hint {
  position: absolute;
  z-index: 2;
  inset-inline-start: var(--pivot);
  inset-block-end: var(--space-md);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--product-card-radius);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-note);
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}
.section-refrigerator .viewer-hint .icon { width: 1em; height: 1em; }
.section-refrigerator .info, .section-refrigerator .models {
  position: absolute;
  z-index: 2;
  top: clamp(52px, 9.5cqh, 110px);
  width: clamp(238px, 24.5cqw, 324px);
}
.section-refrigerator .info {
  left: clamp(12px, 1.5cqw, 22px);
  width: clamp(278px, 25.8cqw, 342px);
}
.section-refrigerator .icon { width: 18px; height: 18px; flex: none; fill: currentColor; }
.section-refrigerator h1 { font-size: var(--text-title); font-weight: 740; letter-spacing: -.055em; line-height: 1.12; }
.section-refrigerator .english { margin-top: 6px; color: var(--muted); font-size: var(--text-ui); font-weight: 500; }
.section-refrigerator .intro { margin-top: 12px; color: var(--lab-card-ink); font-size: var(--text-ui); line-height: 1.5; word-break: keep-all; }
.section-refrigerator .summary-layout {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  gap: var(--rail-gap);
  margin-top: 17px;
  height: var(--info-panel-height);
  align-items: stretch;
}
.section-refrigerator .summary-content, .section-refrigerator .product-summary:not([hidden]) {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.section-refrigerator .summary-content .summary-panel, .section-refrigerator .summary-content .part-card {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
.section-refrigerator :is(.summary-panel, .part-card) {
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  box-shadow: var(--lab-card-shadow);
  backdrop-filter: blur(14px);
}
.section-refrigerator .summary-panel {
  min-width: 0;
  padding: clamp(12px, 1.45cqw, 20px);
}
.section-refrigerator .summary-panel h2 { font-size: var(--text-section); font-weight: 720; letter-spacing: -.025em; }
.section-refrigerator .summary-facts {
  --fact-icon-size: 20px;
  --fact-value-size: 1.125rem;
  --fact-value-weight: 700;
  display: grid;
  gap: var(--space-lg);
  margin: var(--space-lg) 0 0;
  line-height: 1.35;
}
.section-refrigerator .summary-facts dt {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}
.section-refrigerator .summary-facts dt .icon {
  width: var(--fact-icon-size);
  height: var(--fact-icon-size);
  color: var(--lab-card-ink);
}
.section-refrigerator .summary-facts dd {
  margin: var(--space-xs) 0 0 calc(var(--fact-icon-size) + var(--space-sm));
  font-size: var(--fact-value-size);
  font-weight: var(--fact-value-weight);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.section-refrigerator .summary-facts--features dt {
  color: var(--lab-card-ink);
  font-size: var(--fact-value-size);
  font-weight: var(--fact-value-weight);
}
.section-refrigerator .summary-facts--features dd {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}
.section-refrigerator .summary-facts #model-price { color: var(--accent); }
.section-refrigerator .models {
  top: clamp(34px, 6cqh, 76px);
  right: max(18px, var(--edge) - 14px);
  width: clamp(252px, 25.5cqw, 364px);
}
.section-refrigerator .models-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.section-refrigerator .models-heading h2 { font-size: var(--text-section); font-weight: 740; letter-spacing: -.025em; }
.section-refrigerator .models-heading span { padding: 4px 9px; border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: var(--text-note); white-space: nowrap; }
.section-refrigerator .model-grid {
  --viewer-card-height: clamp(146px, 26cqh, 184px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.section-refrigerator .part-pin {
  position: absolute;
  left: var(--pin-x);
  top: var(--pin-y);
  width: 32px;
  height: 27px;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  pointer-events: auto;
}
.section-refrigerator .part-pin[data-part="glass"], .section-refrigerator .part-pin[data-part="shelf"] { width: max(32px, 26%); }
.section-refrigerator .part-pin[data-part="handle"] { width: 23px; height: 62px; }
.section-refrigerator .door-label {
  position: absolute;
  top: 50%;
  right: calc(100% + 2px);
  transform: translateY(-50%);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--lab-card-shadow);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.section-refrigerator .door-label .icon { width: 13px; height: 13px; }
.section-refrigerator .part-pin[data-part="handle"]:hover .door-label,
.section-refrigerator .part-pin[data-part="handle"][aria-pressed="true"] .door-label { background: var(--lab-card-selected); }
.section-refrigerator .part-pin::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px #1766469c, 0 2px 4px #29496550;
  content: "";
  opacity: 0;
}
.section-refrigerator .part-pin[aria-controls]::after, .section-refrigerator .part-pin:hover::after, .section-refrigerator .part-pin:focus-visible::after { opacity: 1; }
.section-refrigerator .part-pin[aria-expanded="true"]::after { box-shadow: 0 0 0 2px #e7f2eb, 0 0 0 3px var(--accent); }
.section-refrigerator .part-pin[hidden], .section-refrigerator .part-card[hidden], .section-refrigerator .part-leader[hidden] { display: none; }
.section-refrigerator .part-leader { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.section-refrigerator .part-leader svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2px;
  stroke-linecap: round;
  filter: drop-shadow(0 0 1px #f0f8ffe0) drop-shadow(0 0 3px #1766464d);
}
.section-refrigerator .part-leader::after {
  position: absolute;
  left: var(--leader-end-x);
  top: var(--leader-end-y);
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border: 1px solid #f3f9ff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #b7dac6;
  content: "";
}
.section-refrigerator .part-card {
  padding: 16px;
  color: var(--lab-card-ink);
}
.section-refrigerator .part-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section-refrigerator .part-card h3 { margin: 0; font-size: var(--text-section); font-weight: 700; letter-spacing: -.025em; }
.section-refrigerator .part-card button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius); background: var(--lab-card-photo); }
.section-refrigerator .part-card button:hover { color: var(--accent); }
.section-refrigerator .part-detail { display: grid; gap: 10px; margin-top: 10px; }
.section-refrigerator .part-detail img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--lab-card-photo); }
.section-refrigerator .part-detail p { font-size: var(--text-body); line-height: 1.55; word-break: keep-all; }

@media (prefers-reduced-motion: reduce) {
  .section-refrigerator .camera, .section-refrigerator .room-world { transition: none; }
}

@media (max-width: 420px) {
  .layout-customer:has(> .layout-refrigerator-card-preview) { min-width: 0; }
  .layout-refrigerator-card-preview {
    grid-template-columns: minmax(0, 214px);
    align-content: start;
    min-height: 100dvh;
  }
  .layout-refrigerator-card-preview > :not(:first-child) { display: none; }
}
