/* ============================================
   LISTADO DE CLÍNICAS - ESTILO BOOKING
   ============================================ */

/* SEARCH HEADER */
.search-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.search-header-inner {
  max-width: 1200px;
}

.search-bar-inline {
  display: flex;
  gap: 8px;
  background: white;
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.search-field-inline {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 8px 14px;
  min-width: 0;
}

.search-field-inline i {
  font-size: 16px;
  color: var(--primary-dark);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-field-inline input {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  background: transparent;
  color: var(--text);
}

.search-btn-inline {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s;
}

.search-btn-inline:hover { background: var(--primary-dark); }

/* LAYOUT */
.listado-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 4rem;
  align-items: start;
  max-width: 1200px;
}

/* SIDEBAR FILTROS */
.filtros-sidebar {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}

.filtros-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.filtros-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filtros-header h2 i {
  font-size: 18px;
  color: var(--primary-dark);
}

.btn-clear-filters {
  font-size: 12px;
  color: var(--primary-dark);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-clear-filters:hover {
  background: var(--primary-light);
}

.filtro-group {
  margin-bottom: 1.5rem;
}

.filtro-group:last-of-type {
  margin-bottom: 0;
}

.filtro-group h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.filtro-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  margin-bottom: 10px;
}

.filtro-search i {
  font-size: 14px;
  color: var(--text-tertiary);
}

.filtro-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  color: var(--text);
}

.filtro-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}

.filtro-options::-webkit-scrollbar { width: 3px; }
.filtro-options::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.filtro-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 0.15s;
}

.filtro-check:hover {
  background: var(--bg-secondary);
}

.filtro-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.filtro-check .city-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 999px;
}

.filtro-loading {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 8px;
}

/* MAIN CONTENT */
.listado-main {
  min-height: 50vh;
}

.listado-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 10px;
}

.results-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.results-count strong {
  color: var(--text);
}

.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 2px;
}

.sort-btn {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s;
}

.sort-btn i { font-size: 13px; }

.sort-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.sort-btn.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  font-weight: 600;
}

/* ACTIVE FILTERS */
.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 5px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  font-weight: 500;
}

.active-filter-tag button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--primary-dark);
  padding: 0;
  margin-left: 2px;
  display: flex;
  align-items: center;
}

/* RESULTS GRID */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* CARD HORIZONTAL */
.clinic-card-h {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.clinic-card-h:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-h-image {
  height: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-light2));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-h-image.alt-1 { background: linear-gradient(135deg, #FBEAF0, #F4C0D1); }
.card-h-image.alt-2 { background: linear-gradient(135deg, #FAEEDA, #FAC775); }
.card-h-image.alt-3 { background: linear-gradient(135deg, #EEEDFE, #CECBF6); }

.card-h-image-icon {
  font-size: 56px;
  opacity: 0.3;
}

.card-h-image .heart-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-h-image .heart-btn i { font-size: 16px; color: var(--text-tertiary); }
.card-h-image .heart-btn.active i { color: var(--danger); }

.card-h-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-h-top {
  flex: 1;
}

.card-h-row1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.card-h-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.card-h-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.card-h-rating-score {
  background: var(--warning);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-h-rating-text {
  font-size: 11px;
  color: var(--text-tertiary);
}

.card-h-address {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.card-h-address i { font-size: 14px; }

.card-h-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-h-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.card-h-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-secondary);
  border-radius: 999px;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-h-tag.tag-24h {
  background: var(--danger);
  color: white;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  box-shadow: 0 1px 3px rgba(226, 75, 74, 0.35);
}
.card-h-tag.tag-24h i { font-size: 12px; }
.card-h-tag.tag-financing { background: #E6F1FB; color: #185FA5; }

/* Paleta rotativa para tags de SERVICIOS — color por hash determinista del
   nombre (cards.js > getServiceColorClass). Mismas tonalidades que la
   portada (styles.css) para que el mismo servicio salga del mismo color
   en ambas vistas. */
.card-h-tag.tag-svc-1 { background: #E1F5EE; color: #0F6E56; }
.card-h-tag.tag-svc-2 { background: #EEEDFE; color: #3C3489; }
.card-h-tag.tag-svc-3 { background: #FAEEDA; color: #854F0B; }
.card-h-tag.tag-svc-4 { background: #FBEAF0; color: #993556; }

.card-h-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-h-price {
  font-size: 13px;
  color: var(--text-secondary);
}

.card-h-price strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.card-h-distance {
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-h-distance i { font-size: 12px; }

.card-h-cta {
  padding: 10px 18px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.card-h-cta:hover { background: var(--primary-dark); }

/* NO RESULTS */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.no-results i {
  font-size: 56px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.no-results h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.no-results p {
  font-size: 14px;
  margin-bottom: 1rem;
}

.btn-clear-all {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* BOTÓN FILTROS MÓVIL */
.btn-show-filters {
  display: none;
  width: 100%;
  padding: 10px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  color: var(--text);
}

.btn-apply-filters {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  font-family: inherit;
}

.filters-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .listado-layout {
    grid-template-columns: 1fr;
  }

  .filtros-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: 300;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .filtros-sidebar.open {
    transform: translateX(0);
  }

  .btn-show-filters { display: flex; }
  .btn-apply-filters { display: block !important; }
}

@media (max-width: 600px) {
  .search-bar-inline {
    flex-direction: column;
    border-radius: var(--radius-md);
    padding: 10px;
  }

  .search-btn-inline {
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .clinic-card-h {
    grid-template-columns: 1fr;
  }

  .card-h-image {
    min-height: 160px;
  }

  .sort-bar { overflow-x: auto; }

  .listado-layout { padding-bottom: 80px; }
}

/* BOTÓN CARGAR MÁS */
.btn-load-more {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 1.5rem;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  text-align: center;
}

.btn-load-more:hover {
  background: var(--primary-light);
}
