/* 3D Stüdyo canlı önizlemesi — ana sayfa (#studyo3d) ve /kuyumcu-3d-render ortak bileşeni */
/* Kapsayıcı bölüm stilleri sayfanın kendi CSS'inde; burada yalnız .d3-* bileşeni */
.d3-box { position: relative; }
.d3-stage {
    --split: 50%;
    position: relative; overflow: hidden; border-radius: 32px; box-shadow: inset 0 0 0 1px var(--line);
    height: min(118vw, 560px); background: #fff; isolation: isolate; user-select: none; -webkit-user-select: none;
}
@media (min-width: 768px) { .d3-stage { height: clamp(420px, 50vw, 720px); max-height: 82vh; } }
.d3-bg { position: absolute; inset: 0; z-index: 0; }
.d3-bg--cad {
    background-color: #eef1f5;
    background-image: linear-gradient(rgba(100, 116, 139, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(100, 116, 139, .09) 1px, transparent 1px);
    background-size: 28px 28px; background-position: center;
    clip-path: inset(0 calc(100% - var(--split)) 0 0);
}
.d3-bg--out { background: radial-gradient(120% 90% at 50% 40%, #ffffff 0%, #ffffff 45%, #f1f3f6 100%); clip-path: inset(0 0 0 var(--split)); }
.d3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; cursor: grab; opacity: 0; transition: opacity .8s var(--ease); }
.d3-canvas:active { cursor: grabbing; }
.d3-box.is-ready .d3-canvas { opacity: 1; }
.d3-tag {
    position: absolute; top: 16px; z-index: 3; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; padding: 7px 11px; border-radius: 999px;
    pointer-events: none; transition: opacity .3s ease;
}
.d3-tag--l { left: 16px; color: var(--muted); background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px var(--line); }
.d3-tag--r { right: 16px; color: #fff; background: var(--ink); }
.d3-split { position: absolute; top: 0; bottom: 0; left: var(--split); width: 1.5px; margin-left: -.75px; z-index: 3; background: rgba(11, 17, 32, .55); pointer-events: none; }
.d3-handle {
    position: absolute; top: 50%; left: var(--split); z-index: 4; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
    display: grid; place-items: center; color: var(--ink); background: #fff; cursor: ew-resize; touch-action: none;
    box-shadow: 0 10px 26px -8px rgba(15, 23, 42, .4), 0 0 0 1px rgba(15, 23, 42, .1);
    transition: transform .3s var(--ease);
}
.d3-handle:hover { transform: scale(1.06); }
.d3-load { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none; transition: opacity .5s ease; }
.d3-load i { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid rgba(15, 23, 42, .12); border-top-color: var(--ink); animation: d3spin .9s linear infinite; }
@keyframes d3spin { to { transform: rotate(360deg); } }
.d3-box.is-ready .d3-load { opacity: 0; }
.d3-hint {
    position: absolute; left: 50%; bottom: 16px; z-index: 3; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--muted);
    padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .8); box-shadow: 0 0 0 1px var(--line); pointer-events: none;
    opacity: 0; transition: opacity .5s ease;
}
.d3-box.is-ready:not(.is-touched) .d3-hint { opacity: 1; }
.d3-fail { display: none; position: absolute; inset: 0; z-index: 5; place-items: center; text-align: center; padding: 24px; color: var(--muted); font-weight: 600; font-size: 14px; }
.d3-box.is-failed .d3-fail { display: grid; }
.d3-box.is-failed .d3-load, .d3-box.is-failed .d3-handle, .d3-box.is-failed .d3-split, .d3-box.is-failed .d3-tag, .d3-box.is-failed .d3-hint { display: none; }
.d3-box.is-failed .d3-bar { opacity: .45; pointer-events: none; }

.d3-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 18px; }
.d3-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.d3-group-t { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.d3-sw {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--bg);
    font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; color: var(--ink-2); transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.d3-sw i { width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12); flex: none; }
.d3-sw:hover { background: #e9edf2; }
.d3-sw[aria-pressed="true"] { background: var(--ink); color: #fff; }
.d3-sw[aria-pressed="true"] i { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
@media (max-width: 639px) {
    .d3-stage { border-radius: 24px; }
    .d3-bar { gap: 10px; }
    .d3-group { width: 100%; justify-content: flex-start; flex-wrap: nowrap; }
    .d3-group-t { width: 46px; flex: none; }
    .d3-sw { height: 38px; padding: 0 11px 0 5px; font-size: 13px; gap: 6px; }
    .d3-sw i { width: 26px; height: 26px; }
}
