/* Shared styles for the 3D viewer overlay (callouts, labels, controls). */
@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url(../assets/fonts/Vazirmatn-Regular.woff2) format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 500; font-display: swap; src: url(../assets/fonts/Vazirmatn-Medium.woff2) format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url(../assets/fonts/Vazirmatn-Bold.woff2) format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 800; font-display: swap; src: url(../assets/fonts/Vazirmatn-ExtraBold.woff2) format("woff2"); }

.vv { position: relative; width: 100%; height: 100%; font-family: Vazirmatn, system-ui, sans-serif; direction: rtl; color: #10203a; -webkit-tap-highlight-color: transparent; }
.vv-stage { position: absolute; inset: 0; }
.vv-stage canvas { cursor: grab; }
.vv-stage canvas:active { cursor: grabbing; }

.vv-callout, .vv-part, .vv-tip { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .25s; white-space: nowrap; will-change: transform; }
.vv-callout { display: flex; direction: ltr; align-items: center; gap: 7px; margin: -15px 0 0 -15px; font-size: 13.5px; font-weight: 700; }
.vv-callout b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #0f55c4; color: #fff; font-size: 15px;
  box-shadow: 0 0 0 4px rgba(255,255,255,.85), 0 6px 16px rgba(15,60,140,.35); }
.vv-callout span { background: rgba(255,255,255,.94); padding: 5px 11px; border-radius: 999px; box-shadow: 0 4px 14px rgba(16,32,58,.16); color: #10203a; }
.vv-callout.left { flex-direction: row-reverse; margin: -15px 0 0 15px; }
.vv-part { margin: -11px 0 0 10px; font-size: 12.5px; font-weight: 500; background: rgba(255,255,255,.92); padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(16,32,58,.14); color: #1a2c4a; }
.vv-part::before { content: ""; position: absolute; left: -13px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #0f55c4; box-shadow: 0 0 0 3px rgba(15,85,196,.2); }
.vv-tip { background: #10203a; color: #fff; font-size: 12.5px; padding: 4px 10px; border-radius: 6px; transition: opacity .12s; z-index: 5; }

.vv-ui { position: absolute; inset: 0; pointer-events: none; }
.vv .vv-ui > * { pointer-events: auto; }
.vv-modes { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 14px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 34px rgba(16,32,58,.16), 0 0 0 1px rgba(16,32,58,.06); }
.vv-modes button { all: unset; cursor: pointer; padding: 9px 16px; border-radius: 10px; font: 500 14px Vazirmatn, sans-serif; color: #3a4a66; display: flex; align-items: center; gap: 7px; transition: background .18s, color .18s; white-space: nowrap; }
.vv-modes button:hover { background: rgba(16,60,120,.07); color: var(--vv-accent, #0f55c4); }
.vv-modes button[aria-pressed="true"] { background: var(--vv-accent, #0f55c4); color: #fff; box-shadow: 0 4px 12px rgba(16,32,58,.25); }
.vv-modes button:focus-visible, .vv-valve:focus-visible { outline: 2px solid #0f55c4; outline-offset: 2px; }
.vv-modes svg { width: 17px; height: 17px; flex: none; }

.vv-valve { all: unset; cursor: pointer; position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 16px; border-radius: 14px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 34px rgba(16,32,58,.14), 0 0 0 1px rgba(16,32,58,.06); font-family: Vazirmatn, sans-serif; }
.vv-valve .sw { width: 50px; height: 28px; border-radius: 999px; background: #c9d2e0; position: relative; transition: background .25s; flex: none; }
.vv-valve .sw::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .25s; }
.vv-valve[aria-pressed="true"] .sw { background: #17a34a; }
.vv-valve[aria-pressed="true"] .sw::after { transform: translateX(-22px); }
.vv-valve .tx { display: flex; flex-direction: column; line-height: 1.35; }
.vv-valve .tx b { font-size: 14.5px; font-weight: 700; color: #10203a; }
.vv-valve .tx small { font-size: 12px; color: #5b6b86; }

.vv-card { position: absolute; top: 16px; left: 16px; width: min(320px, calc(100% - 32px)); padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 14px 40px rgba(16,32,58,.18), 0 0 0 1px rgba(16,32,58,.06);
  opacity: 0; transform: translateY(-8px); transition: opacity .22s, transform .22s; pointer-events: none; }
.vv-card.on { opacity: 1; transform: none; pointer-events: auto; }
.vv-card h4 { margin: 0 0 2px; font-size: 16.5px; font-weight: 800; color: #10203a; }
.vv-card .en { font: 500 12px/1.4 system-ui, sans-serif; color: #7a889f; direction: ltr; text-align: right; letter-spacing: .02em; }
.vv-card .mat { display: inline-block; margin: 10px 0 8px; padding: 3px 10px; border-radius: 999px; background: #e8f0fd; color: #0f55c4; font-size: 12.5px; font-weight: 500; }
.vv-card p { margin: 0; font-size: 13.5px; line-height: 1.95; color: #33435e; }
.vv-card .x { all: unset; cursor: pointer; position: absolute; top: 10px; left: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #7a889f; font-size: 18px; }
.vv-card .x:hover { background: #eef2f8; color: #10203a; }

.vv-hint { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: #5b6b86; background: rgba(255,255,255,.7); padding: 4px 12px; border-radius: 999px; transition: opacity .4s; white-space: nowrap; }
.vv-load { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(180deg, #f5f8fc, #e6edf6); transition: opacity .5s; z-index: 6; }
.vv-load.off { opacity: 0; pointer-events: none; }
.vv-load .box { text-align: center; font-size: 14px; color: #3a4a66; }
.vv-load .bar { width: 190px; height: 5px; border-radius: 9px; background: #d6deea; overflow: hidden; margin: 12px auto 0; }
.vv-load .bar i { display: block; height: 100%; width: 4%; background: var(--vv-accent, #0f55c4); border-radius: 9px; transition: width .2s; }

@media (max-width: 640px) {
  .vv-modes { bottom: 10px; gap: 2px; padding: 4px; max-width: calc(100% - 16px); }
  .vv-modes button { padding: 8px 10px; font-size: 12.5px; gap: 5px; }
  .vv-modes svg { display: none; }
  .vv-valve { top: 10px; right: 10px; padding: 7px 10px 7px 12px; gap: 9px; }
  .vv-valve .tx small { display: none; }
  .vv-card { top: auto; bottom: 62px; left: 8px; right: 8px; width: auto; padding: 12px 14px; }
  .vv-card p { font-size: 12.5px; line-height: 1.8; }
  .vv-hint { display: none; }
  .vv-callout span { display: none; }
}
@media (pointer: coarse) {
  .vv-modes, .vv-valve, .vv-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .vv-modes { background: rgba(255, 255, 255, .95); }
  .vv-valve { background: rgba(255, 255, 255, .96); }
  .vv-card { background: rgba(255, 255, 255, .98); }
}
@media (prefers-reduced-motion: reduce) { .vv-card, .vv-callout, .vv-part { transition: none; } }
