/* ══════════════════════════════════════════════════════
   İPEK YOLU — 3D tahta katmanı
   ══════════════════════════════════════════════════════ */

/* 3D tuval */
.tahta-3d {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 6px;
  overflow: hidden;
  cursor: grab;
  display: none;
}
.tahta-3d[hidden] { display: none; }
.tahta.mod3d .tahta-3d[hidden] { display: none; }
.tahta.mod3d .tahta-3d { display: block; }
.tahta-3d:active { cursor: grabbing; }
.tahta-3d canvas { display: block; width: 100% !important; height: 100% !important; }

/* 3D açıkken 2D tahtayı gizle */
.tahta.mod3d .tahta-ic { display: none; }
.tahta.mod3d .tahta-merkez { display: none; }
.tahta.mod3d .tahta-3d { display: block; }

/* 3D modda tahta daha geniş alan kullanır */
.tahta.mod3d {
  width: min(100%, calc(100vh - 170px), 820px);
}
.tahta.mod3d .tahta-3d { border-radius: 8px; }

/* ── Etiket katmanı ── */
.etiket-kat {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.etiket-kare {
  position: absolute;
  left: 0; top: 0;
  min-width: 24px;
  max-width: 44px;
  padding: 2px 3px 3px;
  border-radius: 3px;
  background: rgba(28, 20, 13, 0.72);
  border: 1px solid rgba(201, 150, 63, 0.3);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  transition: background 0.2s, border-color 0.2s;
  will-change: transform;
  transform-origin: center;
}

.et-ad {
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.015em;
  color: #F0E2C4;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.et-fiyat {
  font-size: 6px;
  font-weight: 600;
  color: #C9963F;
  line-height: 1;
  opacity: 0.9;
}

/* sahiplik göstergesi: sol kenar bandı */
.et-sahip {
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: var(--sahip-renk, transparent);
  box-shadow: 0 0 8px var(--sahip-renk, transparent);
}

.etiket-kare.sahipli {
  background: rgba(38, 28, 18, 0.92);
  border-color: var(--sahip-renk, rgba(201, 150, 63, 0.5));
}

.etiket-kare.ishani {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(231, 192, 120, 0.5);
}

.etiket-kare.vakifli {
  border-color: rgba(143, 176, 138, 0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 14px rgba(143, 176, 138, 0.35);
}

.et-bina {
  position: absolute;
  top: -5px;
  right: -4px;
  font-size: 9px;
  line-height: 1;
  color: #E7C078;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.et-bina.vakif { color: #8FB08A; }

/* köşe ve özel kareler biraz daha geniş */
.etiket-kare.tip-kose {
  max-width: 72px;
  background: rgba(52, 36, 18, 0.9);
  border-color: rgba(231, 192, 120, 0.6);
}
.etiket-kare.tip-kose .et-ad { font-size: 8.5px; color: #F6E9C9; }

.etiket-kare.tip-ozel {
  background: rgba(58, 24, 18, 0.88);
  border-color: rgba(200, 110, 90, 0.5);
}

.etiket-kare.tip-lojistik {
  background: rgba(24, 40, 30, 0.88);
  border-color: rgba(127, 166, 143, 0.5);
}

/* mobilde etiketler küçülür */
@media (max-width: 900px) {
  .etiket-kare {
    min-width: 26px;
    max-width: 48px;
    padding: 2px 3px 3px;
    border-radius: 3px;
  }
  .et-ad { font-size: 6.5px; }
  .et-fiyat { font-size: 6px; }
  .etiket-kare.tip-kose { max-width: 52px; }
  .etiket-kare.tip-kose .et-ad { font-size: 7px; }
}

/* 3D yükleniyor */
.tahta-3d::after {
  content: 'Kervan haritası yükleniyor…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8C7658;
  background: rgba(20, 15, 10, 0.6);
  z-index: 1;
  opacity: 0;
  animation: yukleniyorGecikme 0.4s 0.15s forwards;
  pointer-events: none;
}
.tahta-3d.hazir::after { display: none; }

@keyframes yukleniyorGecikme {
  to { opacity: 1; }
}

/* 3D mod düğmesi */
.mod3d-buton {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 20;
  background: rgba(28, 20, 13, 0.9);
  border: 1px solid rgba(201, 150, 63, 0.4);
  border-radius: 6px;
  color: #E7C078;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: 0.16s;
  backdrop-filter: blur(4px);
}
.mod3d-buton:hover {
  background: rgba(201, 150, 63, 0.2);
  border-color: #C9963F;
}
.mod3d-buton .m3-ikon { font-size: 11px; }

@media (max-width: 900px) {
  .mod3d-buton { font-size: 8px; padding: 5px 9px; right: 6px; bottom: 6px; }
}
