/* ============================================
   Buzlime — 3D makine incelemesi
   ============================================ */

/* overflow-x: hidden sticky'yi bozar; clip görsel olarak aynıdır ama bozmaz */

.m3d {
  position: relative;
  height: 230vh; /* kaydırma mesafesi = bir tam tur (eskiden 340vh: kullanıcı ekranlarca takılı kalıyordu) */
}

.m3d-sticky {
  position: sticky;
  top: var(--nav-h, 72px); /* menü yüksekliği (buzlime.css) */
  height: calc(100vh - var(--nav-h, 72px));
  height: calc(100svh - var(--nav-h, 72px));
  display: flex;
  flex-direction: column;
  padding: 32px 0 18px;
  overflow: hidden;
}

.m3d-head .h1 { margin-bottom: 10px; max-width: none; font-size: clamp(30px, 3.8vw, 50px); }
.m3d-head .subtitle { margin-bottom: 14px; }
.m3d-head-row .text-link { font-size: 14.5px; }
.m3d-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

.m3d-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--teal-deep);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: opacity 0.4s;
}

.m3d-hint svg { width: 16px; height: 16px; }
.m3d--touched .m3d-hint { opacity: 0.5; }

.m3d-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.m3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y; /* dikey kaydırma sayfaya, yatay sürükleme makineye */
  cursor: grab;
  opacity: 0;
  transition: opacity 0.8s var(--ease-smooth);
}

.m3d-canvas:active { cursor: grabbing; }
.m3d--ready .m3d-canvas { opacity: 1; }

.m3d-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
}

.m3d--ready .m3d-loading,
.m3d--fallback .m3d-loading { display: none; }

/* Etiketler */
.m3d-tags {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.m3d-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  will-change: transform, opacity;
}

.m3d-tag.is-left span { text-align: right; }

.m3d-tag::before {
  content: '';
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal-deep);
  border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(25, 184, 173, 0.25);
}

.m3d-tag.is-left { flex-direction: row-reverse; }

.m3d-tag span {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.25;
  width: max-content;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* Açıya göre değişen açıklamalar */
.m3d-steps {
  list-style: none;
  position: relative;
  width: min(560px, calc(100% - 32px));
  height: 84px;
  margin: 0 auto;
}

.m3d-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease-smooth), transform 0.45s var(--ease-smooth);
}

.m3d-step.is-active {
  opacity: 1;
  transform: none;
}

.m3d-step b {
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
}

.m3d-step p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.m3d-progress {
  width: min(240px, 60%);
  height: 3px;
  margin: 8px auto 0;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.m3d-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--teal-deep);
}

/* Hareket azaltılmışsa: uzun kaydırma yok, sadece sürükleme */
.m3d--static { height: auto; }
.m3d--static .m3d-sticky { position: relative; top: auto; height: 92svh; }
.m3d--static .m3d-progress { display: none; }

/* WebGL yoksa: fotoğraf */
.m3d-fallback { display: none; }
.m3d--fallback { height: auto; }
.m3d--fallback .m3d-sticky { position: relative; top: auto; height: auto; }
.m3d--fallback .m3d-canvas,
.m3d--fallback .m3d-tags,
.m3d--fallback .m3d-hint,
.m3d--fallback .m3d-steps,
.m3d--fallback .m3d-progress { display: none; }
.m3d--fallback .m3d-fallback {
  display: block;
  max-width: min(360px, 80%);
  height: auto;
  margin: 24px auto 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

@media (max-width: 720px) {
  .m3d { height: 210vh; }
  .m3d-sticky { padding-top: 20px; }
  .m3d-head .subtitle { display: none; }
  .m3d-tag span { font-size: 11px; padding: 5px 9px; }
  .m3d-steps { height: 100px; }
  .m3d-step p { font-size: 14px; }
}

/* ---------- Kaplama tasarımı seçici ---------- */
.m3d-designs { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.m3d-designs-label { font-weight: 600; font-size: 13px; color: var(--ink-soft); margin-right: 2px; }
.m3d-design {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 6px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink);
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.m3d-design i { width: 18px; height: 18px; border-radius: 50%; background: var(--sw, var(--accent)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px rgba(23, 58, 70, 0.18); }
.m3d-design:hover { background: var(--ice); }
.m3d-design[aria-pressed="true"] { background: var(--ink); color: #fff; }
.m3d-design[aria-pressed="true"] i { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.4); }
.m3d-design:focus-visible { outline: 2px solid var(--teal-deep); outline-offset: 2px; }
.m3d--switching .m3d-canvas { opacity: 0.85; transition: opacity 0.2s; }
/* WebGL yoksa (yedek fotoğraf gösterilirken) seçici gizlenir */
.m3d--fallback .m3d-designs { display: none; }
@media (max-width: 640px) {
  .m3d-designs-label { display: none; }
  .m3d-designs { padding-left: 4px; }
  .m3d-design { padding: 4px 9px 4px 5px; font-size: 13px; }
}
