/* ================================================================
   CASA — buscador.css
   Estilos exclusivos da página de buscador de células
   ================================================================ */

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  background: var(--black);
  padding: 120px clamp(20px,4vw,48px) 48px;
  position: relative; overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 50%, rgba(184,151,58,.07) 0%, transparent 60%);
  pointer-events: none;
}
.page-header-inner { max-width: 1320px; margin: 0 auto; position: relative; }
.page-header h1 {
  font-family: var(--serif); font-size: clamp(2.5rem,6vw,4.5rem);
  font-weight: 900; color: var(--white); line-height: 1; letter-spacing: -.02em; margin-bottom: 16px;
}
.page-header h1 em { font-style: italic; color: var(--gold); }
.page-header-desc { font-size: 16px; font-weight: 300; color: rgba(255,255,255,.45); max-width: 520px; line-height: 1.8; }

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar { background: var(--black); padding: 0 clamp(20px,4vw,48px) 28px; }
.search-bar-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.search-field { display: flex; flex-direction: column; gap: 6px; }
.search-field label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.3); font-weight: 600; }
.search-input {
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 12px 16px;
  font-size: 14px; font-family: var(--sans); color: var(--white);
  outline: none; transition: border-color .2s; -webkit-appearance: none;
}
.search-input::placeholder { color: rgba(255,255,255,.25); }
.search-input:focus { border-color: rgba(184,151,58,.6); }
.search-input option { background: #1a1a1a; color: var(--white); }
.btn-geo {
  padding: 12px 20px; border-radius: 10px;
  background: rgba(184,151,58,.15); border: 1.5px solid rgba(184,151,58,.35);
  color: var(--gold); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: background .2s, border-color .2s; white-space: nowrap; align-self: flex-end;
}
.btn-geo:hover     { background: rgba(184,151,58,.25); border-color: var(--gold); }
.btn-geo.active    { background: var(--gold); color: var(--black); border-color: var(--gold); }
.btn-geo:disabled  { opacity: .5; cursor: not-allowed; }
.view-toggle {
  display: flex; align-self: flex-end; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
}
.view-btn {
  padding: 11px 16px; font-size: 13px; color: rgba(255,255,255,.35);
  transition: color .2s, background .2s; display: flex; align-items: center; gap: 6px;
}
.view-btn.active    { background: rgba(184,151,58,.15); color: var(--gold); }
.view-btn:hover:not(.active) { color: rgba(255,255,255,.7); }

/* ── Layout mapa + sidebar ───────────────────────────────────── */
.buscador-layout {
  display: grid; grid-template-columns: 360px 1fr;
  height: calc(100vh - 72px);
  position: sticky; top: 72px;
}
.celulas-sidebar {
  display: flex; flex-direction: column; height: 100%;
  overflow: hidden; border-right: 1px solid var(--border); background: var(--white);
}
.celulas-sidebar-header {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.celulas-sidebar-header h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; }
.celulas-sidebar-header p  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.celulas-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.celulas-list::-webkit-scrollbar { width: 3px; }
.celulas-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Card lateral ────────────────────────────────────────────── */
.celula-card {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  display: flex; gap: 12px; align-items: flex-start;
}
.celula-card:hover, .celula-card.selected { background: var(--cream); }
.celula-card.selected { border-left: 3px solid var(--gold); }
.celula-card-img {
  width: 52px; height: 52px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; background: var(--border);
}
.celula-card-body { flex: 1; min-width: 0; }
.celula-card-name { font-family: var(--serif); font-size: .95rem; font-weight: 700; color: var(--black); margin-bottom: 3px; line-height: 1.2; }
.celula-card-address { font-size: 11px; color: var(--muted); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.celula-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.celula-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); background: rgba(0,0,0,.05); padding: 2px 7px; border-radius: 20px;
}
.celula-pill i { font-size: 8px; }
.celula-pill.leader { color: var(--gold); background: rgba(184,151,58,.1); }
.celula-dist { font-size: 11px; color: var(--gold); font-weight: 600; margin-left: auto; flex-shrink: 0; }

/* ── Paginação ───────────────────────────────────────────────── */
.pagination {
  padding: 14px 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.pagination p { font-size: 11px; color: var(--muted); }
.pagination-btns { display: flex; gap: 6px; }
.pagination-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--cream); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  transition: background .2s;
}
.pagination-btn:hover:not(:disabled) { background: var(--gold); color: var(--black); border-color: var(--gold); }
.pagination-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ── Mapa ────────────────────────────────────────────────────── */
#celulas-map { flex: 1; height: 100%; min-height: 400px; background: var(--cream); z-index: 1; }

.leaflet-popup-content-wrapper { border-radius: 12px !important; box-shadow: 0 8px 32px rgba(0,0,0,.18) !important; border: none !important; overflow: hidden; padding: 0 !important; }
.leaflet-popup-content { margin: 0 !important; }
.map-popup { padding: 16px; min-width: 200px; }
.map-popup h4 { font-family: var(--serif); font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.map-popup p  { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.map-popup a  { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; }

/* ── Grid view ───────────────────────────────────────────────── */
.celulas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.celula-grid-card {
  background: var(--white); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); transition: transform .25s, box-shadow .25s; cursor: pointer;
}
.celula-grid-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.1); }
.celula-grid-thumb { height: 160px; overflow: hidden; background: var(--cream); }
.celula-grid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.celula-grid-body  { padding: 18px; }
.celula-grid-name  { font-family: var(--serif); font-size: 1rem; font-weight: 700; margin-bottom: 5px; }
.celula-grid-address { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.celula-grid-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border); margin-top: 10px;
}
.btn-celula-wa {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 8px;
  background: rgba(34,197,94,.1); color: #16a34a;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; transition: background .2s;
}
.btn-celula-wa:hover { background: rgba(34,197,94,.2); }

/* ── Skeletons ───────────────────────────────────────────────── */
.skeleton-card { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; }
.skeleton-img  { width: 52px; height: 52px; border-radius: 8px; background: var(--border); flex-shrink: 0; animation: shimmer 1.5s infinite; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.skeleton-line  { height: 11px; border-radius: 6px; background: var(--border); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state i { font-size: 32px; color: var(--border); margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .buscador-layout { grid-template-columns: 1fr; height: auto; position: static; }
  .celulas-sidebar { height: 55vh; }
  #celulas-map     { height: 50vh; }
  .search-bar-inner { flex-direction: column; }
  .btn-geo, .view-toggle { width: 100%; justify-content: center; }
}
@media (max-width: 580px) {
  .page-header { padding: 100px 20px 36px; }
}
