/* ==========================================================================
   Glass Layers Explorer
   Exploded-view diagram using clip-path parallelograms for angle illusion.
   ========================================================================== */

/* --- Section --- */
.glass-explorer {
  padding: 60px 0;
  background: #fff;
}

.glass-explorer__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1a3a6b;
  margin-bottom: 8px;
}

.glass-explorer__heading {
  font-size: 1.85rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
  line-height: 1.2;
}

.glass-explorer__intro-text {
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 40px;
}

/* --- Grid layout --- */
.glass-explorer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}

/* --- Scene & assembly --- */
.glass-explorer__scene {
  background: #f2f4f6;
  border-radius: 10px;
  padding: 28px 24px 20px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.glass-explorer__assembly {
  position: relative;
  --ge-pane-w: 152px;
  --ge-pane-h: 380px;
  --ge-x-scale: 1;
  /* Clip-path visible area is ~28%-100% of pane height, so visible height ≈ 72% */
  --ge-visible-h: calc(var(--ge-pane-h) * 0.72);
  width: calc(var(--ge-pane-w) + 354px * var(--ge-x-scale));
  height: var(--ge-visible-h);
  margin: 0 auto;
}

/* --- Shared pane clip-path --- */
.glass-explorer__pane {
  position: absolute;
  width: var(--ge-pane-w);
  height: var(--ge-pane-h);
  left: calc(var(--x) * var(--ge-x-scale));
  top: calc(var(--ge-pane-h) * -0.28);
  cursor: pointer;
  clip-path: polygon(17.5% 55.1%, 89.5% 28%, 92.5% 28%, 92.5% 75%, 89.5% 76%, 17.5% 100%);
  transition: opacity 0.35s ease, filter 0.35s ease;
}

/* ── Glass panes (layers 1, 3, 6, 8) ── */
.glass-explorer__pane--glass {
  background:
    linear-gradient(
      180deg,
      rgba(122, 160, 194, 0.14) 0%,
      rgba(73, 113, 151, 0.30) 10%,
      rgb(25 143 216 / 33%) 24%,
      rgb(55 118 187 / 30%) 58%,
      rgb(42 95 154 / 42%) 100%
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.07) 5%,
      transparent 14%,
      transparent 83%,
      rgba(255, 255, 255, 0.10) 92%,
      rgba(255, 255, 255, 0.24) 100%
    );
  border: 1px solid rgba(200, 220, 240, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 28px rgba(255, 255, 255, 0.03),
    inset 0 -18px 30px rgba(0, 0, 0, 0.06);
}

.glass-explorer__pane--glass::before {
  content: "";
  position: absolute;
  inset: -5% -8% 24% 7%;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.12) 18%,
    rgba(255, 255, 255, 0.03) 30%,
    transparent 42%);
  filter: blur(10px);
  opacity: 0.45;
  pointer-events: none;
}

.glass-explorer__pane--glass::after {
  content: "";
  position: absolute;
  top: 0.4%;
  right: 0.6%;
  bottom: 0.3%;
  width: 9.4%;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 8%,
    rgba(8, 26, 41, 0.14) 16%,
    rgba(255, 255, 255, 0.08) 24%,
    rgba(255, 255, 255, 0.24) 34%,
    rgba(16, 44, 64, 0.24) 44%,
    rgba(255, 255, 255, 0.10) 56%,
    rgba(255, 255, 255, 0.30) 66%,
    rgba(14, 39, 59, 0.30) 79%,
    rgba(255, 255, 255, 0.08) 100%);
  box-shadow:
    inset 4px 0 8px rgba(255, 255, 255, 0.06),
    inset -8px 0 12px rgba(0, 0, 0, 0.10);
  opacity: 0.80;
  pointer-events: none;
}

/* ── PVB interlayers (layers 2, 7) ── */
.glass-explorer__pane--pvb {
  background:
    linear-gradient(180deg,
      rgba(194, 168, 100, 0.03) 0%,
      rgba(175, 148, 78, 0.08) 10%,
      rgba(155, 128, 58, 0.11) 24%,
      rgba(145, 118, 48, 0.14) 58%,
      rgba(135, 108, 38, 0.16) 100%),
    linear-gradient(90deg,
      rgba(255, 248, 230, 0.10) 0%,
      rgba(255, 248, 230, 0.03) 5%,
      transparent 14%,
      transparent 83%,
      rgba(255, 248, 230, 0.05) 92%,
      rgba(255, 248, 230, 0.12) 100%);
  border: 1px solid rgba(220, 200, 150, 0.20);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 215, 0.06),
    inset 0 0 20px rgba(255, 245, 215, 0.03);
}

.glass-explorer__pane--pvb::before {
  content: "";
  position: absolute;
  inset: -5% -8% 30% 7%;
  background: linear-gradient(135deg,
    rgba(255, 248, 220, 0.25) 0%,
    rgba(255, 248, 220, 0.08) 20%,
    transparent 38%);
  filter: blur(10px);
  opacity: 0.4;
  pointer-events: none;
}

.glass-explorer__pane--pvb::after {
  content: "";
  position: absolute;
  top: 0.4%;
  right: 0.6%;
  bottom: 0.3%;
  width: 9.4%;
  background: linear-gradient(90deg,
    rgba(255, 240, 200, 0.20) 0%,
    rgba(180, 150, 80, 0.12) 20%,
    rgba(255, 240, 200, 0.18) 40%,
    rgba(160, 130, 60, 0.20) 60%,
    rgba(255, 240, 200, 0.14) 80%,
    rgba(180, 150, 80, 0.10) 100%);
  box-shadow:
    inset 3px 0 6px rgba(255, 245, 215, 0.06),
    inset -6px 0 10px rgba(0, 0, 0, 0.08);
  opacity: 0.75;
  pointer-events: none;
}

/* ── Low-E coating (layer 4) ── */
.glass-explorer__pane--coating {
  background:
    linear-gradient(180deg,
      rgba(148, 128, 204, 0.08) 0%,
      rgba(128, 108, 184, 0.18) 10%,
      rgba(115, 95, 170, 0.26) 24%,
      rgba(108, 88, 162, 0.32) 58%,
      rgba(100, 80, 155, 0.38) 100%),
    linear-gradient(90deg,
      rgba(220, 210, 255, 0.14) 0%,
      rgba(220, 210, 255, 0.04) 5%,
      transparent 14%,
      transparent 83%,
      rgba(220, 210, 255, 0.06) 92%,
      rgba(220, 210, 255, 0.16) 100%);
  border: 1px solid rgba(180, 165, 225, 0.22);
  box-shadow: inset 0 0 20px rgba(180, 165, 225, 0.04);
}

.glass-explorer__pane--coating::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    transparent 20%,
    rgba(200, 180, 255, 0.10) 35%,
    rgba(180, 210, 255, 0.06) 50%,
    transparent 65%);
  pointer-events: none;
}

.glass-explorer__pane--coating::after {
  content: "";
  position: absolute;
  top: 0.4%;
  right: 0.6%;
  bottom: 0.3%;
  width: 9.4%;
  background: linear-gradient(90deg,
    rgba(200, 185, 240, 0.18) 0%,
    rgba(140, 120, 190, 0.10) 30%,
    rgba(200, 185, 240, 0.15) 60%,
    rgba(140, 120, 190, 0.08) 100%);
  opacity: 0.65;
  pointer-events: none;
}

/* ── Argon gas fill (layer 5) ── */
.glass-explorer__pane--gas {
  background:
    radial-gradient(circle, rgba(140, 170, 205, 0.18) 1.2px, transparent 1.2px),
    linear-gradient(180deg,
      rgba(180, 200, 220, 0.02) 0%,
      rgba(160, 185, 210, 0.06) 50%,
      rgba(180, 200, 220, 0.03) 100%);
  background-size: 11px 11px, 100% 100%;
  border: 1px dashed rgba(160, 185, 210, 0.12);
  box-shadow: none;
}

.glass-explorer__pane--gas::before,
.glass-explorer__pane--gas::after {
  display: none;
}

/* ── Animated gas particles (used by glass-layers-explorer-gas-anim.twig) ── */
.glass-explorer__particle {
  position: absolute;
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: rgba(120, 160, 200, var(--a, 0.22));
  pointer-events: none;
  animation:
    ge-px var(--dur-x) ease-in-out var(--del) infinite,
    ge-py var(--dur-y) ease-in-out var(--del-y) infinite;
}

@keyframes ge-px {
  0%   { translate: 0 0; }
  33%  { translate: var(--dx) 0; }
  66%  { translate: var(--dx2) 0; }
  100% { translate: 0 0; }
}

@keyframes ge-py {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(var(--dy)); }
}


/* --- Group labels --- */
.glass-explorer__group-label {
  position: absolute;
  top: -26px;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  pointer-events: none;
  white-space: nowrap;
}

/*
.glass-explorer__group-label::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: #ddd;
}
*/

/* --- Orientation labels --- */
.glass-explorer__orientation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 0 4px;
}

.glass-explorer__orient-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
}

.glass-explorer__orient-line {
  flex: 1;
  height: 1px;
  background: #ddd;
  margin: 0 12px;
  position: relative;
}

.glass-explorer__orient-line::before,
.glass-explorer__orient-line::after {
  content: '';
  position: absolute;
  top: -3px;
  border: 4px solid transparent;
}

.glass-explorer__orient-line::before {
  left: 0;
  border-right-color: #ddd;
  border-left: none;
}

.glass-explorer__orient-line::after {
  right: 0;
  border-left-color: #ddd;
  border-right: none;
}

/* --- Pane labels (visible on active) --- */
.glass-explorer__pane-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1a3a6b;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* --- Hover --- */
.glass-explorer__pane:hover {
  filter: brightness(1.06) saturate(1.3);
  opacity: 1;
  z-index: 5;
}

/* --- Interaction states --- */
.glass-explorer__pane.is-dimmed {
  opacity: 0.18;
  filter: grayscale(0.5);
}

.glass-explorer__pane.is-active {
  opacity: 1;
  filter: brightness(1.08) drop-shadow(0 4px 20px rgba(42, 111, 219, 0.25));
  z-index: 10;
}

.glass-explorer__pane.is-active .glass-explorer__pane-label {
  opacity: 1;
}

/* --- Detail panel --- */
.glass-explorer__detail {
  min-height: 380px;
  scroll-margin-top: 80px;
}

.glass-explorer__panel {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.glass-explorer__panel.is-visible {
  display: block;
  animation: ge-panel-enter 0.3s ease forwards;
}

@keyframes ge-panel-enter {
  to { opacity: 1; transform: translateY(0); }
}

.glass-explorer__detail-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a3a6b;
  margin-bottom: 8px;
}

.glass-explorer__detail-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
  line-height: 1.25;
}

.glass-explorer__detail-subtitle {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 16px;
  font-style: italic;
}

.glass-explorer__detail-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #333;
  margin-bottom: 16px;
}

.glass-explorer__detail-specs {
  padding-left: 0;
  list-style: none;
  margin-bottom: 24px;
}

.glass-explorer__detail-specs li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #444;
}

.glass-explorer__detail-specs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a3a6b;
}

.glass-explorer__detail-cta {
  display: inline-block;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: #1a3a6b;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.2s;
}

.glass-explorer__detail-cta:hover {
  background: #254d8a;
  color: #fff;
  text-decoration: none;
}

/* --- Nav bar --- */
.glass-explorer__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}

.glass-explorer__nav-arrow {
  background: none;
  border: none;
  color: #999;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.glass-explorer__nav-arrow:hover {
  color: #1a3a6b;
  background: rgba(26, 58, 107, 0.06);
}

.glass-explorer__nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0d0d0;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.glass-explorer__nav-dot:hover { background: #999; }

.glass-explorer__nav-dot[aria-selected="true"] {
  background: #1a3a6b;
  transform: scale(1.35);
}

.glass-explorer__nav-dot:focus-visible,
.glass-explorer__nav-arrow:focus-visible {
  outline: 2px solid #2a6fdb;
  outline-offset: 2px;
}

/* --- Crawler fallback --- */
.glass-explorer.js-enhanced .glass-explorer__fallback { display: none; }

.glass-explorer__fallback {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.glass-explorer__fallback h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.glass-explorer__fallback p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 20px;
}

/* --- Responsive: tablet --- */
@media (max-width: 991px) {
  .glass-explorer__assembly {
    --ge-pane-w: 125px;
    --ge-pane-h: 310px;
    --ge-x-scale: 0.82;
  }

  .glass-explorer__grid { gap: 32px; }
  .glass-explorer__heading { font-size: 1.6rem; }
  .glass-explorer__detail { min-height: 320px; }
}

/* --- Responsive: mobile --- */
@media (max-width: 767px) {
  .glass-explorer { padding: 40px 0; }

  .glass-explorer__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .glass-explorer__assembly {
    --ge-pane-w: 100px;
    --ge-pane-h: 250px;
    --ge-x-scale: 0.62;
  }

  .glass-explorer__scene { padding: 22px 16px 16px; }
  .glass-explorer__detail { min-height: 0; }
  .glass-explorer__heading { font-size: 1.4rem; }
  .glass-explorer__intro-text { margin-bottom: 24px; }
  .glass-explorer__group-label { font-size: 0.48rem; top: -22px; }
}

/* --- Responsive: small mobile --- */
@media (max-width: 479px) {
  .glass-explorer__assembly {
    --ge-pane-w: 78px;
    --ge-pane-h: 195px;
    --ge-x-scale: 0.46;
  }

  .glass-explorer__group-label { display: none; }
  .glass-explorer__pane-label { font-size: 0.52rem; }
}
