/* main.css — iskelet: tipografi, başlık/nav, butonlar, modal, çerez, form, güvenli alan, erişilebilirlik.
   Renkler config.php'den header.php içinde :root değişkenlerine basılır. Mobil öncelikli. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* header.php yoksa diye yedek; gerçek değerler config'ten gelir */
  --c1: #0ea5a4; --c2: #0f172a; --c3: #f8fafc; --accent: #f59e0b;
  --line: #e2e8f0; --muted: #64748b; --ok: #16a34a; --bad: #dc2626;
  --radius: 14px; --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --header-h: 64px;
  --wrap: 1080px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html {
  /* madde 19: sabit üst menü başlıkları kapatmasın */
  scroll-padding-top: calc(var(--header-h) + 12px);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--c2);
  background: var(--c3);
  overflow-wrap: break-word;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: clamp(22px, 3.4vw, 32px); }
p { margin: 0 0 1em; }
a { color: var(--c1); }
img, svg { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.section { padding: clamp(40px, 7vw, 76px) 0; border-bottom: 1px solid var(--line); }
.section--tight { padding: clamp(28px, 4vw, 44px) 0; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.center { text-align: center; margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* madde 20: içeriğe geç + görünür odak */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1200;
  background: var(--c2); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── Başlık / navigasyon ── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--c3) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--c2); text-decoration: none; font-size: 1.1rem; }
.brand svg { width: 30px; height: 30px; }
.nav-spacer { flex: 1; }
.nav-menu { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-menu a {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--c2);
  text-decoration: none; font-weight: 600; font-size: .96rem;
}
.nav-menu a:hover { background: color-mix(in srgb, var(--c1) 12%, transparent); }
.nav-menu a[aria-current="page"] { color: var(--c1); background: color-mix(in srgb, var(--c1) 14%, transparent); }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line);
  background: #fff; border-radius: 12px; cursor: pointer;
}
.nav-toggle span { height: 2px; background: var(--c2); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Butonlar ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c1); color: #fff; }
.btn--primary:hover { box-shadow: 0 8px 22px color-mix(in srgb, var(--c1) 45%, transparent); }
.btn--accent { background: var(--accent); color: #111; }
.btn--ghost { background: #fff; color: var(--c2); border-color: var(--line); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ── Yüzen aksiyonlar (masaüstü) + mobil sabit bar (madde 6) ── */
.fab { position: fixed; right: 18px; bottom: calc(18px + var(--safe-b)); z-index: 900; display: none; flex-direction: column; gap: 10px; }
.fab a {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: #fff; box-shadow: var(--shadow);
}
.fab .fab-call { background: var(--c1); }
.fab .fab-wa { background: #25d366; color: #073b1e; }

.mobilebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px;
  background: var(--line); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.mobilebar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; background: #fff; color: var(--c2); font-weight: 700; text-decoration: none;
}
.mobilebar a.is-wa { color: #0b6b35; }

/* ── Çağrı modalı (madde 7) ── */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center;
  padding: 18px; background: rgba(15, 23, 42, .55);
}
.modal-card {
  background: #fff; border-radius: var(--radius); padding: 24px; width: min(420px, 100%);
  box-shadow: var(--shadow); text-align: center;
}
.modal-phone { font-size: 1.6rem; font-weight: 800; letter-spacing: .5px; margin: 10px 0 18px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.modal-close { position: absolute; }

/* ── Kopyala bildirimi (madde 8) ── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: var(--c2); color: #fff; padding: 12px 18px; border-radius: 999px; z-index: 1300;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; font-weight: 600;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Çerez onayı (madde 15) ── */
.cookie[hidden] { display: none; }
.cookie {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 1050;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; max-width: var(--wrap); margin-inline: auto;
}
.cookie p { margin: 0; flex: 1 1 280px; font-size: .92rem; color: var(--muted); }
.cookie .cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Formlar (madde 10/12) ── */
.form { display: grid; gap: 16px; max-width: 560px; }
.field { display: grid; gap: 6px; }
.field > label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; color: var(--c2); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c1); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 25%, transparent); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: .85rem; min-height: 1em; }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: 10px; }
.field--check input { width: 20px; height: 20px; margin-top: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* madde 11: honeypot */
.form-status { font-weight: 600; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-bad { color: var(--bad); }
/* JS'siz gönderim sonucu (lead.php 303 → ?gonderildi=1 / ?hata=<kod>): formun hemen üstünde görünür bildirim. JS açıkken ilk gönderimde gizlenir. */
.form-notice { margin: 18px 0 0; max-width: 560px; padding: 12px 14px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; background: #fff; font-weight: 600; }
.form-notice[hidden] { display: none; }
.form-notice.is-ok { border-left-color: var(--ok); }
.form-notice.is-bad { border-left-color: var(--bad); }
.btn[hidden] { display: none; }   /* .btn display'i [hidden]'ı ezmesin (kupon yokken "Kodu kopyala" gizlenir) */
/* JS kapalıyken: arama penceresi / WhatsApp düğmeleri çalışmaz → doğrudan bağlantılar (header.php <noscript>) */
.noscript-hint { background: var(--c2); color: #fff; padding: 10px 16px; font-size: .92rem; text-align: center; }
.noscript-hint a { color: #fff; font-weight: 700; margin-left: 10px; }

/* ── Footer ── */
.site-footer { background: var(--c2); color: #cbd5e1; padding: 40px 0 28px; }
.site-footer a { color: #e2e8f0; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.footer-grid h3 { color: #fff; font-size: 1rem; }
.footer-cols { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .85rem; color: #94a3b8; display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; }
.site-footer .pad-mobilebar { height: 0; }

/* ── Masaüstü ── */
@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .nav-menu { position: static; }
  .fab { display: flex; }
  .mobilebar { display: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

/* ── Mobil nav açılır menü ── */
@media (max-width: 859px) {
  .nav-menu {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--c3); border-bottom: 1px solid var(--line); padding: 10px 16px 18px;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    box-shadow: var(--shadow);
  }
  .nav-menu.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-menu a { padding: 14px 12px; font-size: 1.05rem; }
  .nav .nav-cta { display: none; }
  .site-footer .pad-mobilebar { height: 64px; } /* sabit bar içeriği kapatmasın */
}

/* madde 23: iPhone çentiği için güvenli alan */
@supports (padding: max(0px)) {
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* madde 22: hareketi azalt */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
