/**
 * Avrupa Oto Buca — iPhone-style theme
 * Tüm projede ortak: ana sayfa vari görünüm, mobil uyumlu, zarif butonlar
 */

/* — TOKENS — */
:root {
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 40px;
  --s8: 48px;
  --s9: 64px;
  --s10: 80px;
  --s11: 96px;
  --s12: 128px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 9999px;
  --brand: #E53935;
  --brand-dark: #C62828;
  --red: #E53935;
  --amber: #F59E0B;
  --green: #22C55E;
  --blue: #2563EB;
  --bg: #FFFFFF;
  --bg-secondary: #F5F5F7;
  --bg-tertiary: #FAFAFA;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --separator: rgba(0, 0, 0, 0.08);
  --separator-opaque: #D2D2D7;
  --fill: rgba(0, 0, 0, 0.04);
  --fill-secondary: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.10), 0 8px 24px rgba(0, 0, 0, 0.06);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-thick: rgba(255, 255, 255, 0.85);
  --btn-h: 44px;
  --btn-h-sm: 40px;
  /* Alias (diğer sayfalardaki var(--bg0) vb. uyumluluk) */
  --bg0: var(--bg-secondary);
  --bg1: var(--surface);
  --line: var(--separator);
  --muted: var(--text-secondary);
  --text: var(--text-primary);
  --r16: var(--r-md);
  --r22: var(--r-lg);
  --shadow: var(--shadow-md);
  --shadow2: var(--shadow-sm);
}

html[data-theme="dark"] {
  --bg: #000000;
  --bg-secondary: #1C1C1E;
  --bg-tertiary: #0A0A0A;
  --surface: #1C1C1E;
  --surface-raised: #2C2C2E;
  --text-primary: #F5F5F7;
  --text-secondary: #A1A1A6;
  --text-tertiary: #6E6E73;
  --separator: rgba(255, 255, 255, 0.10);
  --separator-opaque: #3A3A3C;
  --fill: rgba(255, 255, 255, 0.06);
  --fill-secondary: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.40);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.50);
  --glass: rgba(28, 28, 30, 0.72);
  --glass-thick: rgba(28, 28, 30, 0.88);
}

/* — ANIMATIONS — */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 12px transparent; }
}

/* — RESET & BASE — */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100vw;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* — TYPOGRAPHY — */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.muted { color: var(--text-secondary); }

/* — LAYOUT — */
.container {
  width: 100%;
  max-width: min(var(--max), 100vw);
  margin: 0 auto;
  padding: 0 var(--s4);
  min-width: 0;
}
@media (min-width: 560px) {
  .container { padding: 0 var(--s5); }
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

/* — ZARİF BUTONLAR (mobil uyumlu, min 44px dokunma) — */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--btn-h);
  padding: 0 var(--s4);
  border-radius: var(--r-md);
  border: none;
  background: var(--fill-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  max-width: 100%;
  position: relative;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--fill);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: scale(0.98);
}
.btn.red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
}
.btn.red:hover {
  background: var(--brand-dark);
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
}
.btn.green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.btn.green:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}
.btn.amber {
  background: var(--amber);
  color: #1a1300;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn.amber:hover {
  filter: brightness(1.06);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--separator);
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--fill);
}
html[data-theme="dark"] .btn {
  background: var(--fill-secondary);
  color: var(--text-primary);
}
html[data-theme="dark"] .btn:hover { background: var(--fill); }
html[data-theme="dark"] .btn.red { background: var(--red); color: #fff; }
html[data-theme="dark"] .btn.green { background: var(--green); color: #fff; }
html[data-theme="dark"] .btn.amber { background: var(--amber); color: #1a1300; }

/* Küçük butonlar (header, kart aksiyonları) */
.btn-sm,
.header-cta .btn,
.district-actions .btn {
  min-height: var(--btn-h-sm);
  padding: 0 var(--s3);
  font-size: 0.8125rem;
  border-radius: var(--r-sm);
}

/* — SKIP LINK — */
.skip {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus {
  left: var(--s4);
  top: var(--s4);
  width: auto;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--separator);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  z-index: 999;
}

/* — CARD — */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--separator);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-lg);
}

/* — CHIP & TAG — */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8125rem;
}
.tag {
  display: inline-flex;
  padding: var(--s1) var(--s3);
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 0.8125rem;
  transition: all 0.25s var(--ease);
}
.tag:hover {
  color: var(--blue);
  background: rgba(37, 99, 235, 0.08);
}
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* — HEADER (iPhone-style cam efekti) — */
header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--glass-thick);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--separator);
}
html[data-theme="dark"] header {
  background: rgba(0, 0, 0, 0.8);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 56px;
}
@media (min-width: 560px) {
  .topbar { min-height: 64px; }
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}
.brand-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-title b, .brand-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-title b { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-title small { font-size: 0.75rem; font-weight: 500; color: var(--text-tertiary); }
.logo-badge {
  height: 40px;
  width: auto;
  min-width: 40px;
  max-width: 140px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.3s var(--ease);
}
.logo-badge .logo-svg {
  height: 100%;
  width: auto;
  display: block;
}
@media (min-width: 560px) {
  .logo-badge { height: 44px; min-width: 44px; max-width: 160px; }
}
.brand:hover .logo-badge { transform: scale(1.02); }
nav.nav { display: flex; gap: 2px; align-items: center; }
nav.nav a {
  display: inline-flex;
  align-items: center;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
nav.nav a:hover {
  color: var(--text-primary);
  background: var(--fill);
}
.header-cta { display: flex; gap: var(--s2); align-items: center; flex-shrink: 0; }
.menu-btn { display: none; }
.drawer { display: none; padding: 0 0 var(--s4); }
.drawer-inner {
  padding: var(--s4);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--separator);
}

/* — HERO — */
.hero { padding: var(--s8) 0 var(--s6); }
@media (min-width: 560px) {
  .hero { padding: var(--s10) 0 var(--s8); }
}
@media (min-width: 980px) {
  .hero { padding: var(--s11) 0 var(--s9); }
}
.hero-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
}
@media (min-width: 980px) {
  .hero-wrap { grid-template-columns: 1.2fr 0.8fr; gap: var(--s9); }
}
.headline {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: var(--s4);
}
.sub {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  max-width: 56ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s5);
}
.hero-actions .btn {
  min-height: 48px;
  padding: 0 var(--s5);
  font-size: 0.9375rem;
}
@media (max-width: 560px) {
  .hero-actions .btn { flex: 1 1 100%; min-width: 0; }
}
.proof { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }

/* — PANEL — */
.panel {
  padding: var(--s5);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 560px) {
  .panel { padding: var(--s6); }
}
.panel h2 { font-size: 1.125rem; margin-bottom: var(--s2); }
.panel p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: var(--s5); }
.quick-grid { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 560px) {
  .quick-grid { grid-template-columns: 1fr 1fr; }
}
.q {
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--fill);
  transition: transform 0.3s var(--ease);
}
.q:hover { transform: translateY(-2px); }
.q b { display: block; font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.q small { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 0.8125rem; }

/* — SECTIONS — */
section { padding: var(--s8) 0; }
@media (min-width: 560px) {
  section { padding: var(--s10) 0; }
}
@media (min-width: 980px) {
  section { padding: var(--s11) 0; }
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s5);
  margin-bottom: var(--s6);
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); letter-spacing: -0.02em; }
.section-head p { color: var(--text-secondary); font-size: 0.9375rem; margin-top: var(--s2); max-width: 60ch; }

/* — SERVICES GRID — */
.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
}
@media (min-width: 560px) {
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .services { grid-template-columns: repeat(3, 1fr); gap: var(--s5); }
}
.service {
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--separator);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.service h3 { font-size: 1.0625rem; margin-bottom: var(--s2); }
.service p { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; }

/* — DISTRICT GRID — */
.district-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
}
@media (min-width: 560px) {
  .district-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .district-grid { grid-template-columns: repeat(3, 1fr); }
}
.district-card {
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--separator);
  transition: all 0.3s var(--ease);
}
.district-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.district-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.district-title { font-weight: 700; font-size: 1rem; }
.district-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
@media (max-width: 560px) {
  .district-actions .btn { flex: 1 1 100%; }
}
.serv-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s2);
  margin-top: var(--s3);
}
@media (min-width: 560px) {
  .serv-links { grid-template-columns: 1fr 1fr; }
}
.slink {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--s3);
  border-radius: var(--r-sm);
  background: var(--fill);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all 0.25s var(--ease);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.slink:hover {
  color: var(--blue);
  background: rgba(37, 99, 235, 0.06);
}

/* — CONTACT & FORM — */
.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
  align-items: stretch;
}
@media (min-width: 980px) {
  .contact { grid-template-columns: 1fr 1fr; }
}
.info { padding: var(--s5); }
.info ul { margin-top: var(--s5); }
.info li {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--separator);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}
.info li b { color: var(--text-primary); font-weight: 600; margin-right: var(--s2); }
.form-card { padding: var(--s5); }
@media (min-width: 560px) {
  .form-card { padding: var(--s6); }
}
.form { display: grid; gap: var(--s3); }
input, textarea {
  width: 100%;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-sm);
  border: 1px solid var(--separator);
  background: var(--bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea {
  background: var(--fill);
  border-color: var(--separator);
}

/* — FOOTER — */
footer {
  margin-top: var(--s8);
  padding: var(--s6) 0 var(--s10);
  padding-bottom: calc(var(--s10) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--separator);
  color: var(--text-tertiary);
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: var(--s5);
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.8125rem;
}
.foot a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
  padding: var(--s2) 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.foot a:hover { color: var(--text-primary); }

/* — FAB (mobil safe-area) — */
.fab-wrap {
  position: fixed;
  right: var(--s4);
  bottom: calc(var(--s4) + env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.fab {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: var(--r-full);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  color: #fff;
  box-shadow: var(--shadow-lg);
  -webkit-tap-highlight-color: transparent;
}
.fab:first-child { background: var(--green); animation: breathe 3s infinite; }
.fab:last-child { background: var(--amber); color: #1a1300; }
.fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-xl);
}

/* — MOBILE: nav gizle, menü göster — */
@media (max-width: 980px) {
  nav.nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .header-cta .btn.red { display: none; }
  .header-cta a[href="#iletisim"] { display: none; }
}
@media (min-width: 981px) {
  .menu-btn { display: none !important; }
  .drawer { display: none !important; }
}

/* Dark tema: ürün görsel alanı her zaman açık — ürün görünsün */
html[data-theme="dark"] .product-showcase .pcard-img,
html[data-theme="dark"] .p-img {
  background: #ececec !important;
}
html[data-theme="dark"] .product-showcase .pcard-img img,
html[data-theme="dark"] .p-img img {
  mix-blend-mode: normal;
}

/* Katalog (lastikler/jantlar): mobilde sidebar üstte, sıralama butonları uyumlu */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; order: -1; }
}
@media (max-width: 560px) {
  .sort-bar .sort-btn { flex: 1 1 auto; min-width: 0; }
  .result-count { width: 100%; margin-bottom: var(--s2); }
}
