/* ==========================================================================
   MOBILE CORE V3 — ZERO-FRICTION UNIVERSAL LAYER (kobi&kobi)
   W3C WCAG 2.2 AA · Apple HIG · Material Design 3 · CWV (INP/CLS/LCP)
   Masaüstü görünümüne dokunmadan < 1024px mobil deneyimi yükseltir.
   ========================================================================== */

:root {
  --mc3-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Kesintisiz klavye & dokunma odak halkası */
:focus-visible {
  outline: 3px solid #1554D1 !important;
  outline-offset: 2px !important;
}

/* Scroll-Driven Staggered Fade-Up (Apple Motion Architecture, CLS=0) */
.mc3-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.52s var(--mc3-ease), transform 0.52s var(--mc3-ease);
  will-change: opacity, transform;
}
.mc3-reveal.mc3-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .mc3-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 1023px) {
  html, body {
    overflow-x: clip;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  body.mc3-no-bottom-bar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* 16px Girdi Boyutu: iOS Safari otomatik zoom engellenir */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  input[type="number"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 48px;
  }

  /* Zorunlu >= 48px dokunma hedefi & INP touch-action */
  button,
  a.btn,
  [role="button"],
  summary {
    touch-action: manipulation;
    min-height: 48px;
  }

  /* Üst Çubuk: Cam efekti + Safe Area + Kaydırmada belirgin sınır */
  header[data-header] {
    padding-top: env(safe-area-inset-top, 0px);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
  }
  header[data-header].mc3-scrolled {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    border-bottom-color: rgba(15, 23, 42, 0.12);
  }

  /* Bağlamsal Geri Butonu (Alt sayfalarda üst çubukta görünür) */
  .mc3-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-left: -8px;
    border-radius: 12px;
    color: #0F172A;
    flex-shrink: 0;
    transition: background-color 0.15s ease, transform 0.12s ease;
  }
  .mc3-back-btn:active {
    background-color: #EBF1F7;
    transform: scale(0.94);
  }

  /* Eski tekli .sticky-cta yerine MOBILE CORE V3 ikili dönüşüm çubuğu */
  .sticky-cta {
    display: none !important;
  }

  .mc3-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 42;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid #D8E2EE;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 10px;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s var(--mc3-ease), opacity 0.2s ease;
  }

  body.mc3-keyboard-open .mc3-bottom-bar,
  body.mc3-no-bottom-bar .mc3-bottom-bar {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }

  .mc3-bar-btn {
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    touch-action: manipulation;
    transition: transform 0.12s ease, background-color 0.15s ease;
  }
  .mc3-bar-btn:active {
    transform: scale(0.98);
  }
  .mc3-bar-secondary {
    background: #FFFFFF;
    color: #0F172A;
    border: 1px solid #BCCBE0;
  }
  .mc3-bar-primary {
    background: #1554D1;
    color: #FFFFFF;
    border: 1px solid #1554D1;
  }

  /* Yüzen WhatsApp butonu alt bar ile çakışmasın */
  a[aria-label="WhatsApp ile yazın"] {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
  }
  body.mc3-no-bottom-bar a[aria-label="WhatsApp ile yazın"],
  body.mc3-keyboard-open a[aria-label="WhatsApp ile yazın"] {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 1024px) {
  .mc3-back-btn,
  .mc3-bottom-bar {
    display: none !important;
  }
}
