/* ============================================================
   HaritaMedya — Ortak Yardımcı Stiller
   ------------------------------------------------------------
   Tailwind'in (CDN) üretmediği, projeye özel ince dokunuşlar.
   Tüm sayfalar bu tek dosyayı paylaşır.
   ============================================================ */

/* Yazı tipi yumuşatma */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .7s ease;   /* hero slaytına göre tüm sayfa arka planı */
}

/* ---- Harita zemini ızgara dokusu (görsel dosyası gerektirmez) ---- */
.map-grid {
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, .07) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* ---- Scroll ile beliren bölümler (JS 'is-visible' ekler) ---- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .7s cubic-bezier(.2, .7, .2, 1),
    transform .7s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Navigasyon link alt çizgi animasyonu ---- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 100%;
  background: #2563EB;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s ease;
}
.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================================
   GÖRSEL YER TUTUCU (PLACEHOLDER)
   ------------------------------------------------------------
   Esnaf kendi görselini buraya koyacak. Her .img-ph kutusunun
   HTML'inde, hemen üstte hangi <img> ile değiştirileceği
   yorum satırı olarak yazılıdır.
   ============================================================ */
.img-ph {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(30, 58, 138, .6);
  background:
    repeating-linear-gradient(45deg, rgba(37, 99, 235, .045) 0 14px, transparent 14px 28px),
    #EEF3FB;
  border: 1.5px dashed rgba(30, 58, 138, .28);
  overflow: hidden;
}
.img-ph::after {
  /* Köşede küçük "DEĞİŞTİR" etiketi */
  content: 'GÖRSEL';
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  color: #fff;
  background: rgba(30, 58, 138, .55);
  padding: 3px 8px;
  border-radius: 999px;
}

/* ---- Yatay kaydırılan şeritlerde scrollbar'ı gizle ---- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   CANLI ÖNİZLEME ÇERÇEVESİ (galeri kartlarındaki mini site)
   ------------------------------------------------------------
   Gerçek demo sayfası bir <iframe> içinde küçültülerek thumbnail
   gibi gösterilir. Ölçek JS (demo-gallery.js) tarafından ayarlanır.
   İstersen iframe yerine düz bir <img> ekran görüntüsü de koyabilirsin.
   ============================================================ */
.preview-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.preview-frame iframe {
  position: absolute;     /* yükseklik orandan (aspect) gelsin; iframe akışı şişirmesin */
  top: 0;
  left: 0;
  border: 0;
  transform-origin: top left;
  pointer-events: none;   /* tıklama kartın linkine geçsin */
}
/* Masaüstü önizleme: 1280×800 (16:10) tasarım, kart genişliğine ölçeklenir */
.preview-frame--desktop iframe { width: 1280px; height: 800px; }
/* Mobil önizleme: 390×760 telefon genişliği — gerçek mobil düzeni gösterir */
.preview-frame--phone   iframe { width: 390px;  height: 760px; }

/* ============================================================
   CİHAZ ÖNİZLEYİCİ (Masaüstü / Tablet / Mobil seçici)
   ------------------------------------------------------------
   #device, sahnenin (#device-stage) içinde JS ile ölçeklenir.
   Cihaz boyutu data-device özniteliğinden gelir.
   ============================================================ */
.device { transform-origin: center center; will-change: transform; }
.device-frame { display: block; border: 0; background: #fff; pointer-events: none; }
.device[data-device="desktop"] .device-frame { width: 1280px; height: 800px; }
.device[data-device="tablet"]  .device-frame { width: 834px;  height: 1112px; }
.device[data-device="mobile"]  .device-frame { width: 390px;  height: 780px; }

/* Cihaz sekmesi aktif durumu */
.dev-tab.is-active { background: #1E3A8A; color: #fff; }
/* Tasarım seçici kart aktif durumu */
.design-card.is-active { border-color: #1E3A8A; box-shadow: 0 0 0 2px rgba(30,58,138,.25); }

/* ============================================================
   CAROUSEL (hero kayan banner)
   ============================================================ */
.carousel-track { display: flex; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.carousel-track > * { flex: 0 0 100%; }
.carousel-dot { width: 8px; height: 8px; border-radius: 9999px; background: rgba(15,23,42,.22); transition: all .3s ease; }
.carousel-dot.is-active { background: #1E3A8A; width: 22px; }

/* ============================================================
   MOBİL — yatay taşmayı engelle + alt gezinme çubuğu (bottom nav)
   ============================================================ */
html, body { overflow-x: hidden; max-width: 100%; }

@media (max-width: 767px) {
  body.has-bottom-nav { padding-bottom: 4.9rem; }   /* alt çubuğa yer aç */
  .hide-on-mobile { display: none !important; }
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: space-around; gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.93);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 -8px 30px -12px rgba(15,23,42,.18);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }   /* yalnız mobil */

.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px; color: #64748B; font-size: 11px; font-weight: 600;
  text-decoration: none; transition: color .2s ease; -webkit-tap-highlight-color: transparent;
}
.bottom-nav a:hover, .bottom-nav a:active { color: #1E3A8A; }
.bottom-nav .bn-icon { width: 22px; height: 22px; }

/* Ortadaki yükseltilmiş WhatsApp aksiyonu */
.bottom-nav .bn-wa { flex: 0 0 auto; color: #128C4A; }
.bottom-nav .bn-circle {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 9999px;
  background: #25D366; color: #fff; display: grid; place-items: center;
  border: 4px solid #fff; box-shadow: 0 12px 26px -8px rgba(37,211,102,.7);
}

/* ---- Hareket azaltma tercihini onurlandır ---- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
