* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --green: #037E21;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-dim: rgba(26, 26, 26, 0.6);
  --shadow: rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --card: #1e2023;
    --text: #f2f2f2;
    --text-dim: rgba(242, 242, 242, 0.6);
    --shadow: rgba(0, 0, 0, 0.5);
  }
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ─── Üst çubuk ─── */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  box-shadow: 0 2px 8px var(--shadow);
}
.app-bar-logo { width: 30px; height: 30px; border-radius: 8px; background: #fff; }
.app-bar h1 { font-size: 1.15rem; font-weight: 700; flex: 1; }
.icon-btn {
  background: none; border: none; color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 6px;
}

/* ─── Arama ─── */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 16px 8px;
  padding: 0 12px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow);
}
.search-icon { color: var(--green); }
.search-wrap input {
  flex: 1; border: none; outline: none; background: none;
  color: var(--text); font-size: 1rem; padding: 13px 0;
}
.search-wrap input::placeholder { color: var(--text-dim); }
.clear-btn {
  background: none; border: none; color: var(--green);
  font-size: 1rem; cursor: pointer; padding: 4px;
}

/* ─── Karusel ─── */
.carousel-wrap { position: relative; margin: 8px 16px 16px; }
.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 12px;
  box-shadow: 0 4px 8px var(--shadow);
  scrollbar-width: none;
  height: 150px;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel .slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: 150px;
  background: var(--card);
}
.carousel .slide img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  cursor: pointer;
}
.carousel-dots {
  position: absolute; bottom: 8px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.carousel-dots .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim); transition: all 0.2s;
}
.carousel-dots .dot.active { width: 10px; height: 10px; background: var(--green); }

/* ─── Marka ızgarası ─── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); } }

.brand-card {
  display: flex; flex-direction: column; align-items: center;
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text);
}
.brand-card:active .brand-logo { transform: scale(0.93); }
.brand-logo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 4px 8px var(--shadow);
  overflow: hidden;
  transition: transform 0.15s;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ─── Durum ekranları ─── */
.state-view {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 64px 32px; gap: 12px;
}
.state-view h2 { font-size: 1.2rem; }
.state-view p { color: var(--text-dim); }
.state-icon { font-size: 3rem; }
.spinner {
  width: 38px; height: 38px;
  border: 4px solid var(--shadow);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.primary-btn {
  background: var(--green); color: #fff; border: none;
  border-radius: 12px; padding: 13px 32px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  margin-top: 8px;
}
.primary-btn.small { padding: 9px 18px; font-size: 0.9rem; margin: 0; }

/* ─── Kurulum banner'ları ─── */
.install-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 6px 24px var(--shadow);
  padding: 14px;
  animation: slideUp 0.35s ease;
}
@keyframes slideUp { from { transform: translateY(120%); } to { transform: translateY(0); } }
.banner-icon { width: 44px; height: 44px; border-radius: 10px; }
.banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.banner-text strong { font-size: 0.95rem; }
.banner-text span { font-size: 0.82rem; color: var(--text-dim); }
.share-glyph { color: #0a84ff; font-weight: 700; }
.banner-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 1rem; cursor: pointer; padding: 6px; align-self: flex-start;
}
