/* assets/entra/css/entra-3d-gallery.css */
/*!
 * ENTRA V14 — 3D Product Viewer Studio Styles (homepage teaser + full gallery page)
 * Scoped to .emg-section / .emg.
 * Brand palette: ENTRA Orange (#f06820), Charcoal (#14171c), White (#ffffff), Industrial Grey (#eef1f5).
 */

/* ===== 1. Tokens ===== */
.emg-section, .emg {
  --emg-bg: #e7ecf2;
  --emg-surface: #f5f7fa;
  --emg-surface-2: #ffffff;
  --emg-char: #14171c;
  --emg-char-2: #1e232b;
  --emg-line: #d0d7e0;
  --emg-fg: #14171c;
  --emg-muted: #525c68;
  --emg-accent: #f06820;
  --emg-accent-ink: #14171c;
  --emg-accent-dark: #c4530f;
  --emg-accent-soft: rgba(240, 104, 32, .14);
  --emg-grid: #b5c0cc;
  --emg-glass: rgba(255, 255, 255, .92);
  --emg-shadow: 0 18px 44px rgba(20, 23, 28, .12);
  --emg-radius: 18px;
  --emg-f-display: "Archivo", "Cairo", system-ui, sans-serif;
  --emg-f-body: "Inter", "Cairo", system-ui, sans-serif;
}

/* ===== 2. Section shell & heading (for homepage teaser) ===== */
.emg-section { position: relative; z-index: 10; padding-block: 4rem 4.5rem; scroll-margin-top: 88px; }
.emg-head { max-width: 48rem; margin: 0 auto 2rem; text-align: center; }
.emg-eyebrow {
  display: inline-block; padding: .35rem .9rem; border-radius: 999px;
  border: 1px solid rgba(240, 104, 32, .4); background: rgba(240, 104, 32, .1);
  color: var(--emg-accent-dark); font: 700 .75rem/1.2 var(--emg-f-body); letter-spacing: .12em; text-transform: uppercase;
}
.emg-title { margin-top: 1rem; color: var(--emg-fg); font: 800 clamp(1.75rem, 3.6vw, 2.75rem)/1.1 var(--emg-f-display); letter-spacing: -.02em; text-wrap: balance; }
.emg-intro { margin-top: .9rem; color: var(--emg-muted); font: 400 1.0625rem/1.6 var(--emg-f-body); }

/* ===== 3. Studio Frame ===== */
.emg {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  min-height: 680px;
  background: var(--emg-surface-2); color: var(--emg-fg);
  border: 1.5px solid var(--emg-line); border-radius: 22px; box-shadow: var(--emg-shadow);
  font: 400 14.5px/1.45 var(--emg-f-body); -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.emg button { font: inherit; color: inherit; cursor: pointer; }
.emg svg { display: block; }
.emg :focus-visible { outline: 2px solid var(--emg-accent); outline-offset: 2px; }
.emg-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ===== 4. Top Studio Telemetry Bar ===== */
.emg-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: var(--emg-char); color: #e6eaef;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.emg-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.emg-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emg-accent); box-shadow: 0 0 0 3px rgba(240, 104, 32, .28); flex: none; }
.emg-kick { color: #ffffff; font: 700 12px/1.2 var(--emg-f-body); letter-spacing: .12em; text-transform: uppercase; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emg-topbar-center { display: flex; align-items: center; }
.emg-status-pill {
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  color: #f4f6f8; font: 600 11.5px/1.2 "JetBrains Mono", var(--emg-f-body); letter-spacing: .06em;
}
.emg-topbar-right { display: flex; align-items: center; gap: 6px; }
.emg-top-btn {
  height: 30px; padding: 0 10px; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06);
  color: #dde3ea; font: 600 12px/1 var(--emg-f-body); transition: background-color .15s, border-color .15s, color .15s;
}
.emg-top-btn:hover { background: var(--emg-accent); border-color: var(--emg-accent); color: var(--emg-char); }

/* ===== 5. Main Split-Screen Workspace (3D Stage + Inspector Panel) ===== */
.emg-workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) 390px;
  flex: 1; min-height: 490px; background: var(--emg-bg);
}

/* 3D Stage */
.emg-stage { position: relative; min-height: 460px; background: var(--emg-bg); overflow: hidden; }
.emg-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; outline: none; -webkit-user-drag: none; user-select: none; }
.emg-gl.is-drag { cursor: grabbing; }

/* On-Canvas Camera Zoom & Reset Controls */
.emg-cam-controls {
  position: absolute; z-index: 3; top: 14px; inset-inline-start: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.emg-cam-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--emg-line); border-radius: 10px;
  background: var(--emg-glass); color: var(--emg-fg);
  box-shadow: 0 6px 18px rgba(20, 23, 28, .1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background-color .15s, border-color .15s, transform .15s;
}
.emg-cam-btn:hover { background: #fff; border-color: var(--emg-accent); color: var(--emg-accent-dark); transform: translateY(-1px); }

/* Animated Numbered Technical Hotspots */
.emg-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transition: opacity .25s; }
.emg-pins.is-off { opacity: 0; }
.emg--nolabels .emg-pins { display: none; }
.emg-pin { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; pointer-events: auto; will-change: transform; cursor: pointer; }
.emg-pin i {
  position: relative; display: grid; place-items: center;
  width: 24px; height: 24px; margin: -12px; flex: none; border-radius: 50%;
  background: var(--emg-accent); color: var(--emg-char);
  font: 800 10.5px/1 var(--emg-f-display); font-style: normal;
  box-shadow: 0 0 0 4px rgba(240, 104, 32, .25), 0 2px 8px rgba(20, 23, 28, .35);
  transition: transform .2s, background-color .2s;
}
.emg-pin i::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid var(--emg-accent); opacity: .65;
  animation: emg-pulse 2.2s cubic-bezier(.19, .8, .22, 1) infinite;
}
@keyframes emg-pulse {
  0% { transform: scale(.85); opacity: .8; }
  75%, 100% { transform: scale(1.55); opacity: 0; }
}
.emg-pin-tag {
  margin-inline-start: 14px; max-width: 220px; padding: 6px 11px;
  border: 1px solid var(--emg-line); border-radius: 10px;
  background: var(--emg-glass); box-shadow: 0 8px 22px rgba(20, 23, 28, .12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}
.emg-pin b { display: block; color: var(--emg-fg); font-size: 12.5px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.emg-pin em { display: block; max-height: 0; overflow: hidden; color: var(--emg-muted); font-size: 11.5px; font-style: normal; line-height: 1.35; transition: max-height .25s, margin .25s; }
.emg-pin:hover em, .emg-pin:focus-within em, .emg-pin.is-active em { max-height: 72px; margin-top: 4px; white-space: normal; }
.emg-pin:hover, .emg-pin:focus-within, .emg-pin.is-active { z-index: 4; }
.emg-pin:hover i, .emg-pin.is-active i { transform: scale(1.14); background: var(--emg-char); color: #fff; }
.emg-pin.is-active .emg-pin-tag { border-color: var(--emg-accent); box-shadow: 0 0 0 2px rgba(240, 104, 32, .28), 0 10px 26px rgba(20, 23, 28, .18); }

/* Prev / Next Paddles & Hint */
.emg-navbar { position: absolute; z-index: 2; bottom: 14px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; pointer-events: none; }
.emg-navbar > * { pointer-events: auto; }
.emg-edge { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--emg-line); border-radius: 50%; background: var(--emg-glass); box-shadow: 0 6px 18px rgba(20, 23, 28, .12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.emg-edge:hover { background: #fff; border-color: var(--emg-accent); }
.emg-edge .emg-ic { width: 20px; height: 20px; }
.emg[dir="rtl"] .emg-edge .emg-ic { transform: scaleX(-1); }
.emg-hint { padding: 5px 14px; border: 1px solid var(--emg-line); border-radius: 999px; background: var(--emg-glass); color: var(--emg-muted); font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; transition: opacity .6s; }
.emg-hint.is-hidden { opacity: 0; }

/* Watermark */
.emg-watermark { position: absolute; z-index: 2; top: 14px; inset-inline-end: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: 45%; pointer-events: none; user-select: none; }
.emg-watermark img { width: clamp(84px, 9vw, 122px); height: auto; padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, .86); border: 1px solid rgba(20, 23, 28, .08); }
.emg-watermark span { padding: 2px 7px; border-radius: 5px; background: rgba(255, 255, 255, .75); color: var(--emg-muted); font-size: 10px; line-height: 1.3; text-align: end; }

/* ===== 6. Integrated Right Product Detail & Component Inspector Panel ===== */
.emg-info {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  padding: 20px 22px; background: var(--emg-surface-2);
  border-inline-start: 1px solid var(--emg-line);
  overflow-y: auto; max-height: 560px;
}
.emg-info-head { display: flex; flex-direction: column; gap: 8px; }
.emg-name { color: var(--emg-fg); font: 800 24px/1.08 var(--emg-f-display); letter-spacing: -.02em; text-wrap: balance; margin: 0; }
.emg[dir="rtl"] .emg-name { font-family: "Cairo", sans-serif; font-size: 22px; line-height: 1.25; letter-spacing: 0; }
.emg-tagline { color: var(--emg-muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.emg-variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.emg-variants[hidden] { display: none; }
.emg-vchip { height: 30px; padding: 0 11px; border: 1px solid var(--emg-line); border-radius: 8px; background: var(--emg-surface); font-size: 12.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; transition: all .15s; }
.emg-vchip:hover { border-color: var(--emg-accent); }
.emg-vchip[aria-pressed="true"] { background: var(--emg-char); border-color: var(--emg-char); color: #fff; }

.emg-more { display: none; }
.emg-more-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }

/* Inspector Sub-Tabs */
.emg-inspector-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; border-radius: 10px; background: var(--emg-surface); border: 1px solid var(--emg-line);
}
.emg-itab {
  height: 32px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--emg-muted);
  font: 700 12px/1 var(--emg-f-body); white-space: nowrap; transition: all .15s;
}
.emg-itab:hover { color: var(--emg-fg); }
.emg-itab.is-active { background: var(--emg-surface-2); color: var(--emg-fg); box-shadow: 0 2px 6px rgba(20, 23, 28, .08); }

.emg-ipanel { display: flex; flex-direction: column; gap: 12px; }
.emg-ipanel[hidden] { display: none; }

.emg-specs { display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--emg-line); margin: 0; }
.emg-specs dt, .emg-specs dd { padding: 6px 0; border-bottom: 1px solid var(--emg-line); font-size: 13px; margin: 0; }
.emg-specs dt { display: flex; align-items: center; padding-inline-end: 12px; color: var(--emg-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.emg-specs dd { text-align: end; color: var(--emg-fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.emg-uses-h { margin: 0 0 6px; color: var(--emg-muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.emg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.emg-chips span { padding: 3px 10px; border: 1px solid var(--emg-line); border-radius: 999px; background: var(--emg-surface); font-size: 12px; font-weight: 600; color: var(--emg-fg); }
.emg-note { color: var(--emg-muted); font-size: 11.5px; line-height: 1.45; margin: 0; }

/* Component Identification List */
.emg-comp-intro { color: var(--emg-muted); font-size: 12px; line-height: 1.45; margin: 0; }
.emg-comp-list { display: flex; flex-direction: column; gap: 7px; padding: 0; margin: 0; list-style: none; }
.emg-comp-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--emg-line); border-radius: 10px; background: var(--emg-surface);
  cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.emg-comp-item:hover { border-color: var(--emg-accent); background: #fff; }
.emg-comp-item.is-active { border-color: var(--emg-accent); background: rgba(240, 104, 32, .08); box-shadow: 0 0 0 2px rgba(240, 104, 32, .2); }
.emg-comp-num {
  display: grid; place-items: center; width: 24px; height: 24px; flex: none;
  border-radius: 6px; background: var(--emg-char); color: #fff;
  font: 800 11px/1 var(--emg-f-display);
}
.emg-comp-item.is-active .emg-comp-num { background: var(--emg-accent); color: var(--emg-char); }
.emg-comp-copy b { display: block; color: var(--emg-fg); font-size: 13px; font-weight: 700; line-height: 1.25; }
.emg-comp-copy span { display: block; margin-top: 2px; color: var(--emg-muted); font-size: 12px; line-height: 1.4; }

/* Related Systems List inside Inspector */
.emg-rel-list { display: flex; flex-direction: column; gap: 7px; }
.emg-rel-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px;
  border: 1px solid var(--emg-line); border-radius: 10px; background: var(--emg-surface);
}
.emg-rel-item img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: #dfe4ea; flex: none; }
.emg-rel-copy { flex: 1; min-width: 0; }
.emg-rel-copy b { display: block; color: var(--emg-fg); font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emg-rel-copy span { display: block; color: var(--emg-muted); font-size: 11px; }
.emg-rel-btn {
  height: 30px; padding: 0 10px; border: 1px solid var(--emg-char); border-radius: 7px;
  background: var(--emg-char); color: #fff; font: 700 11.5px/1 var(--emg-f-body); white-space: nowrap;
}
.emg-rel-btn:hover { background: var(--emg-accent); border-color: var(--emg-accent); color: var(--emg-char); }

/* Inspector Action Footer */
.emg-info-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--emg-line); }
.emg-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 10px; background: var(--emg-accent); color: var(--emg-char);
  font: 700 13.5px/1 var(--emg-f-body); text-decoration: none; transition: background-color .15s;
}
.emg-cta:hover { background: #ff7d36; }
.emg-page { color: var(--emg-fg); font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.emg-page:hover { color: var(--emg-accent-dark); text-decoration: underline; }

/* ===== 7. Bottom Dock: Simulation Toolbar & Thumbnail Selector Rail ===== */
.emg-dock {
  position: relative; z-index: 4; flex: none; display: flex; flex-direction: column; gap: 10px;
  padding: 12px 16px 14px; border-top: 1px solid var(--emg-line); background: var(--emg-surface);
}
.emg-toolbar, .emg-rail { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.emg-toolbar::-webkit-scrollbar, .emg-rail::-webkit-scrollbar { display: none; }
.emg-toolbar { align-items: center; }
.emg-tool, .emg-speed {
  display: inline-flex; align-items: center; flex: none; height: 36px; padding: 0 11px;
  border: 1px solid var(--emg-line); border-radius: 9px; background: var(--emg-surface-2);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.emg-tool { position: relative; overflow: hidden; gap: 6px; }
.emg-tool:hover { border-color: var(--emg-char); }
.emg-tool[aria-pressed="true"] { background: var(--emg-accent-soft); border-color: var(--emg-accent); color: var(--emg-fg); }
.emg-tool[aria-pressed="true"] .emg-ic { color: var(--emg-accent-dark); }
.emg-tool[data-emg-ref="tour"]::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--emg-accent); }
.emg-speed { gap: 8px; }
.emg-speed output { min-width: 4.5em; color: var(--emg-muted); text-align: end; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.emg-speed input { width: 105px; accent-color: var(--emg-accent); }

/* Optimized WebP Thumbnail Selector Strip */
.emg-rail { gap: 8px; scroll-snap-type: x proximity; padding-bottom: 2px; }
.emg-card {
  position: relative; flex: none; display: flex; align-items: center; gap: 10px;
  width: 215px; height: 60px; padding: 6px 10px 6px 6px;
  border: 1px solid var(--emg-line); border-radius: 11px; background: var(--emg-surface-2);
  text-align: start; scroll-snap-align: start; transition: border-color .15s, box-shadow .15s;
}
.emg-card:hover { border-color: #9aa5b4; }
.emg-card-thumb {
  position: relative; width: 64px; height: 46px; flex: none;
  border-radius: 7px; overflow: hidden; background: #e3e7ec; border: 1px solid rgba(20, 23, 28, .08);
}
.emg-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emg-card-num {
  position: absolute; top: 2px; inset-inline-start: 2px; padding: 1px 4px;
  border-radius: 4px; background: rgba(20, 23, 28, .82); color: #fff;
  font: 700 9.5px/1.1 "JetBrains Mono", monospace;
}
.emg-card-txt {
  font: 700 12.5px/1.2 var(--emg-f-display); color: var(--emg-fg);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.emg[dir="rtl"] .emg-card-txt { font-family: "Cairo", sans-serif; font-size: 13px; line-height: 1.3; }
.emg-card[aria-current="true"] {
  border-color: var(--emg-accent); background: #fff;
  box-shadow: 0 0 0 2px rgba(240, 104, 32, .25);
}
.emg-card[aria-current="true"] .emg-card-num { background: var(--emg-accent); color: var(--emg-char); }

/* ===== 8. Loading / failure / fullscreen ===== */
.emg-loading { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: var(--emg-bg); text-align: center; transition: opacity .5s; }
.emg-loading.is-done { opacity: 0; pointer-events: none; }
.emg-loading p { margin-top: 12px; color: var(--emg-muted); }
.emg-spin { width: 34px; height: 34px; margin: 0 auto; border: 3px solid var(--emg-line); border-top-color: var(--emg-accent); border-radius: 50%; animation: emg-spin 1s linear infinite; }
@keyframes emg-spin { to { transform: rotate(360deg); } }
.emg--failed .emg-dock, .emg--failed .emg-info, .emg--failed .emg-navbar { display: none; }
.emg-more-link { margin-top: 1.5rem; text-align: center; }
.emg--fs { width: 100vw; height: 100vh !important; border: 0; border-radius: 0; }
.emg:fullscreen { width: 100vw; height: 100vh; border-radius: 0; }

/* ===== 9. Responsive (Tablet & Mobile) ===== */
@media (max-width: 1024px) {
  .emg-workspace { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 899px) {
  .emg-section { padding-block: 3rem; }
  .emg { min-height: 0; border-radius: 18px; }
  .emg-topbar-center { display: none; }
  .emg-workspace { display: flex; flex-direction: column; min-height: 0; }
  .emg-stage { height: clamp(340px, 52vh, 440px); min-height: 340px; flex: none; }
  .emg-info {
    border-inline-start: 0; border-top: 1px solid var(--emg-line);
    max-height: none; padding: 16px; gap: 10px;
  }
  .emg-name { font-size: 20px; }
  .emg[dir="rtl"] .emg-name { font-size: 19px; }
  .emg-tagline { font-size: 13px; }
  .emg-hint, .emg-lbl { display: none; }
  .emg-tool { padding: 0 10px; }
  .emg-dock { padding-inline: 12px; }
  .emg-card { width: 188px; height: 54px; }
  .emg-watermark span { display: none; }
  .emg-watermark img { width: 84px; padding: 4px 6px; }
}
@media (max-width: 520px) {
  .emg-topbar { flex-wrap: wrap; padding: 8px 12px; }
  .emg-topbar-right { width: 100%; justify-content: flex-start; }
  .emg-top-btn { flex: 1; text-align: center; padding: 0 6px; font-size: 11px; }
  .emg-stage { height: 320px; min-height: 320px; }
  .emg-speed input { width: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .emg *, .emg *::before, .emg *::after { animation: none !important; transition: none !important; }
}

