/**
 * Korobit Firma Rehberi — mobil öncelikli, erişilebilir arayüz
 * Tipografi: Plus Jakarta Sans (Google Fonts, view’larda link)
 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --rb-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --rb-primary: #0d9488;
  --rb-primary-dark: #0f766e;
  --rb-primary-soft: rgba(13, 148, 136, 0.12);
  --rb-accent: #f59e0b;
  --rb-accent-soft: rgba(245, 158, 11, 0.15);
  --rb-text: #1e293b;
  --rb-text-muted: #64748b;
  --rb-bg: #f1f5f9;
  --rb-bg-gradient: linear-gradient(165deg, #ecfdf5 0%, #f1f5f9 45%, #f8fafc 100%);
  --rb-card: #ffffff;
  --rb-border: #e2e8f0;
  --rb-radius: 14px;
  --rb-radius-sm: 10px;
  --rb-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --rb-shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --rb-shadow-card: 0 4px 24px rgba(15, 23, 42, 0.07);
  --rb-header-h: 0px;
  --rb-touch: 48px;
  --rb-max: 920px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.rehber-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--rb-bg);
  background-image: var(--rb-bg-gradient);
  font-family: var(--rb-font);
  color: var(--rb-text);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

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

/* ——— Üst bar (tam genişlik cam efekt) ——— */
.rehber-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rb-border);
  box-shadow: var(--rb-shadow);
  padding-left: clamp(0.75rem, 3vw, 1.25rem);
  padding-right: clamp(0.75rem, 3vw, 1.25rem);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.rehber-header-inner {
  width: 100%;
  max-width: var(--rb-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rehber-logo {
  flex-shrink: 0;
}

.rehber-logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: var(--rb-radius-sm);
  padding: 0.15rem;
}

.rehber-logo a:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
}

.rehber-logo img {
  max-height: 40px;
  width: auto;
  display: block;
}

.rehber-nav-top {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.2rem 0;
  max-width: 100%;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.rehber-nav-top::-webkit-scrollbar {
  display: none;
}

.rehber-nav-top a {
  color: var(--rb-text);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.rehber-nav-top a:hover {
  background: var(--rb-primary-soft);
  color: var(--rb-primary-dark);
}

.rehber-nav-top a:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
}

.rehber-search-form {
  display: flex;
  width: 100%;
  flex: 1 1 100%;
  order: 3;
  border: 1px solid var(--rb-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--rb-card);
  box-shadow: var(--rb-shadow);
  min-height: var(--rb-touch);
}

.rehber-search-form input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  min-width: 0;
}

.rehber-search-form input::placeholder {
  color: #94a3b8;
}

.rehber-search-form input:focus {
  outline: none;
}

.rehber-search-form button {
  padding: 0 1.15rem;
  background: linear-gradient(135deg, var(--rb-primary) 0%, var(--rb-primary-dark) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  flex-shrink: 0;
}

.rehber-search-form button:hover {
  filter: brightness(1.05);
}

.rehber-search-form button:focus-visible {
  outline: 2px solid var(--rb-primary-dark);
  outline-offset: -2px;
}

@media (min-width: 720px) {
  .rehber-header-inner {
    flex-wrap: nowrap;
  }
  .rehber-search-form {
    order: 0;
    flex: 0 1 260px;
    max-width: 300px;
  }
  .rehber-nav-top {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: none;
  }
  .rehber-nav-top a {
    font-size: 0.875rem;
  }
}

/* ——— Ana içerik ——— */
.rehber-container {
  width: 100%;
  max-width: var(--rb-max);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 1.75rem) clamp(0.75rem, 4vw, 1.25rem);
}

/* Breadcrumb */
.rehber-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--rb-text-muted);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  padding-bottom: 4px;
}

.rehber-breadcrumb::-webkit-scrollbar {
  display: none;
}

.rehber-breadcrumb a {
  color: var(--rb-primary-dark);
  text-decoration: none;
  font-weight: 500;
}

.rehber-breadcrumb a:hover {
  text-decoration: underline;
}

.rehber-breadcrumb a:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.rehber-breadcrumb span:not(.sep) {
  color: var(--rb-text);
  font-weight: 600;
}

.rehber-breadcrumb .sep {
  margin: 0 0.35rem;
  color: #cbd5e1;
  user-select: none;
}

@media (min-width: 640px) {
  .rehber-breadcrumb {
    white-space: normal;
    overflow-x: visible;
  }
}

/* Hero (liste / şehir başlığı) */
.rehber-hero {
  background: var(--rb-card);
  border-radius: var(--rb-radius);
  padding: clamp(1.1rem, 4vw, 1.65rem);
  margin-bottom: 1.35rem;
  border: 1px solid var(--rb-border);
  box-shadow: var(--rb-shadow-card);
  position: relative;
  overflow: hidden;
}

.rehber-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--rb-primary), #2dd4bf, var(--rb-accent));
  border-radius: var(--rb-radius) var(--rb-radius) 0 0;
}

.rehber-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.rehber-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--rb-primary-dark);
  background: var(--rb-primary-soft);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.rehber-page-title {
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  font-weight: 700;
  color: var(--rb-text);
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.rehber-lead,
.rehber-intro {
  color: var(--rb-text-muted);
  font-size: 0.9375rem;
  margin: 0.65rem 0 0 0;
  max-width: 62ch;
}

.rehber-result-count {
  font-size: 0.9rem;
  color: var(--rb-text-muted);
  margin: 0 0 1.15rem 0;
  line-height: 1.5;
}

.rehber-result-count strong,
.rehber-result-count b {
  color: var(--rb-text);
  font-weight: 700;
}

.rehber-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rb-text);
  margin: 1.5rem 0 0.65rem 0;
  letter-spacing: -0.01em;
}

.rehber-mahalle-block {
  margin-bottom: 0.5rem;
}

.rehber-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rb-text);
  margin: 1.5rem 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--rb-primary-soft);
}

.rehber-section-title:first-of-type {
  margin-top: 0;
}

/* Kart ızgarası */
.rehber-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 152px), 1fr));
  gap: 0.65rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 480px) {
  .rehber-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.85rem;
  }
}

.rehber-card-grid li {
  margin: 0;
}

.rehber-card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: var(--rb-touch);
  padding: 0.75rem 0.85rem;
  background: var(--rb-card);
  border-radius: var(--rb-radius-sm);
  text-decoration: none;
  color: var(--rb-text);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--rb-border);
  box-shadow: var(--rb-shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
  line-height: 1.35;
  hyphens: auto;
  word-break: break-word;
}

.rehber-card-link:hover {
  border-color: var(--rb-primary);
  box-shadow: var(--rb-shadow-md);
  color: var(--rb-primary-dark);
  transform: translateY(-2px);
}

.rehber-card-link:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
}

.rehber-card-link.ilce {
  border-left: 4px solid var(--rb-primary);
}

.rehber-card-link.kategori {
  border-left: 4px solid var(--rb-accent);
}

/* Firma kartları */
.rehber-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rehber-firma-card {
  background: var(--rb-card);
  border-radius: var(--rb-radius);
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--rb-border);
  box-shadow: var(--rb-shadow-card);
  transition: box-shadow 0.25s, border-color 0.25s;
  position: relative;
  padding-left: 1.35rem;
}

.rehber-firma-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--rb-primary), #5eead4);
}

.rehber-firma-card:hover {
  box-shadow: var(--rb-shadow-md);
  border-color: #cbd5e1;
}

.rehber-firma-card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.rehber-firma-card h3 a {
  color: var(--rb-text);
  text-decoration: none;
}

.rehber-firma-card h3 a:hover {
  color: var(--rb-primary-dark);
}

.rehber-firma-card h3 a:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.rehber-firma-card .firma-desc {
  color: var(--rb-text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.45rem;
  line-height: 1.55;
}

.rehber-firma-card .firma-web {
  font-size: 0.8125rem;
  color: var(--rb-primary-dark);
  margin-bottom: 0.65rem;
  font-weight: 500;
}

.rehber-firma-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rehber-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.15s, filter 0.15s, background 0.15s;
  border: 2px solid transparent;
  cursor: pointer;
}

.rehber-btn:active {
  transform: scale(0.98);
}

.rehber-btn-primary {
  background: linear-gradient(135deg, var(--rb-primary) 0%, var(--rb-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.rehber-btn-primary:hover {
  filter: brightness(1.06);
  color: #fff;
}

.rehber-btn-primary:focus-visible {
  outline: 2px solid var(--rb-primary-dark);
  outline-offset: 2px;
}

.rehber-btn-outline {
  background: var(--rb-card);
  color: var(--rb-primary-dark);
  border-color: var(--rb-border);
}

.rehber-btn-outline:hover {
  background: var(--rb-primary-soft);
  border-color: var(--rb-primary);
}

.rehber-btn-outline:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
}

/* Sayfalama */
.rehber-pagination {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--rb-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.rehber-pagination a {
  color: var(--rb-primary-dark);
  text-decoration: none;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  min-height: var(--rb-touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--rb-border);
  background: var(--rb-card);
  box-shadow: var(--rb-shadow);
}

.rehber-pagination a:hover {
  background: var(--rb-primary-soft);
  border-color: var(--rb-primary);
}

.rehber-pagination a:focus-visible {
  outline: 2px solid var(--rb-primary);
  outline-offset: 2px;
}

.rehber-pagination .current {
  color: var(--rb-text-muted);
  font-weight: 600;
  padding: 0.5rem;
}

/* Boş durum */
.rehber-empty {
  background: var(--rb-card);
  border-radius: var(--rb-radius);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
  border: 2px dashed var(--rb-border);
}

.rehber-empty h2 {
  font-size: 1.1rem;
  color: var(--rb-text-muted);
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.rehber-empty a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--rb-touch);
  padding: 0 1.25rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  background: var(--rb-primary);
  border-radius: 999px;
}

.rehber-empty a:hover {
  background: var(--rb-primary-dark);
}

/* Küçük mobil */
@media (max-width: 520px) {
  .rehber-pagination {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 0.5rem;
  }
  .rehber-pagination::-webkit-scrollbar {
    display: none;
  }
  .rehber-pagination .current {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  .rehber-card-grid {
    grid-template-columns: 1fr;
  }
  .rehber-firma-actions {
    flex-direction: column;
  }
  .rehber-btn {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .rehber-firma-card .firma-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
