/* ── BUSCADOR ── */
.search-section {
  background: white; 
  border-bottom: 1px solid var(--border);
  position: sticky; 
  top: var(--header-height);
  z-index: 50;
  box-shadow: 0 4px 24px rgba(30,44,79,0.07);
}

.search-inner {
  padding: 24px 8%;
  display: flex; 
  align-items: center; 
  gap: 16px; 
  flex-wrap: wrap;
}

.search-box { 
  flex: 1; 
  min-width: 260px; 
  position: relative; 
}

.search-icon-left {
  position: absolute; 
  left: 16px; 
  top: 50%; 
  transform: translateY(-50%);
  color: var(--gray); 
  pointer-events: none; 
  transition: color 0.3s; 
  z-index: 1;
}

.search-box:focus-within .search-icon-left { 
  color: var(--coral); 
}

.search-box input {
  width: 100%; 
  padding: 14px 16px 14px 48px;
  border: 1.5px solid var(--border); 
  border-radius: 10px;
  font-family: var(--font-body); 
  font-size: 0.95rem; 
  color: var(--navy);
  background: var(--cream); 
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.search-box input::placeholder { 
  color: var(--gray); 
}

.search-box input:focus {
  border-color: var(--coral); 
  background: white;
  box-shadow: 0 0 0 3px rgba(227,89,44,0.1);
}

.filter-group { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  flex-wrap: wrap; 
}

.filter-label {
  font-size: 0.75rem; 
  font-weight: 600; 
  letter-spacing: 0.1em;
  text-transform: uppercase; 
  color: var(--gray); 
  white-space: nowrap;
}

.filter-select {
  padding: 13px 40px 13px 16px;
  border: 1.5px solid var(--border); 
  border-radius: 10px;
  font-family: var(--font-body); 
  font-size: 0.9rem; 
  color: var(--navy);
  background: var(--cream); 
  outline: none; 
  cursor: pointer;
  -webkit-appearance: none; 
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8f9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; 
  background-position: right 14px center;
  transition: border-color 0.3s, box-shadow 0.3s; 
  min-width: 200px;
}

.filter-select:focus { 
  border-color: var(--coral); 
  box-shadow: 0 0 0 3px rgba(227,89,44,0.1); 
}

.btn-clear {
  padding: 13px 20px; 
  border-radius: 10px;
  border: 1.5px solid var(--border); 
  background: transparent;
  font-family: var(--font-body); 
  font-size: 0.85rem; 
  color: var(--gray);
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  gap: 8px;
  transition: all 0.3s; 
  white-space: nowrap;
}

.btn-clear:hover { 
  border-color: var(--coral); 
  color: var(--coral); 
  background: rgba(227,89,44,0.05); 
}

/* ── BARRA RESULTADOS ── */
.results-bar {
  padding: 14px 8%; 
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 16px; 
  flex-wrap: wrap;
}

.results-count { 
  font-size: 0.85rem; 
  color: var(--gray); 
}

.results-count strong { 
  color: var(--navy); 
  font-weight: 600; 
}

.view-toggle { 
  display: flex; 
  gap: 6px; 
}

.view-btn {
  width: 36px; 
  height: 36px; 
  border-radius: 8px;
  border: 1.5px solid var(--border); 
  background: transparent;
  display: flex; 
  align-items: center; 
  justify-content: center;
  cursor: pointer; 
  color: var(--gray); 
  transition: all 0.3s;
}

.view-btn.active, 
.view-btn:hover {
  border-color: var(--coral); 
  color: var(--coral); 
  background: rgba(227,89,44,0.06);
}

/* ── GRID PROFESIONALES ── */
.main-content { 
  padding: 40px 8% 80px; 
}

.profesionales-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 24px; 
}

.profesionales-grid.list-view { 
  grid-template-columns: 1fr; 
}

/* ── CARD PROFESIONAL ── */
.prof-card {
  background: white; 
  border-radius: 16px; 
  border: 1px solid var(--border);
  overflow: hidden; 
  display: flex; 
  flex-direction: column;
  transition: box-shadow 0.35s, transform 0.35s, border-color 0.35s;
}

.prof-card:hover {
  box-shadow: 0 20px 56px rgba(30,44,79,0.11);
  transform: translateY(-4px); 
  border-color: rgba(227,89,44,0.2);
}

.list-view .prof-card { 
  flex-direction: row; 
  align-items: stretch; 
}

/* ── HEADER DE LA CARD CON COLOR ── */
.prof-header {
  padding: 24px 24px 18px;
  position: relative;
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.prof-header-content {
  flex: 1;
  /* Eliminado: padding-right: 80px; ya no es necesario */
}

.prof-header-name {
  font-family: var(--font-display);
  font-size: 1.4rem; /* Aumentado de 1.2rem a 1.4rem */
  font-weight: 600;
  color: white;
  line-height: 1.2;
  margin-bottom: 4px;
}

.prof-header-sub {
  font-size: 0.85rem; /* Aumentado de 0.78rem a 0.85rem */
  color: rgba(255,255,255,0.85);
  font-weight: 400;
}

.prof-header-ubicacion {
  font-size: 0.78rem; /* Aumentado de 0.72rem a 0.78rem */
  color: rgba(255,255,255,0.75);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prof-header-ubicacion svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: rgba(255,255,255,0.75);
}

/* ── BODY DE LA CARD ── */
.prof-body {
  padding: 18px 22px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.prof-name-block {
  margin-bottom: 4px;
}

.prof-especialidad-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
  padding: 3px 12px;
  border-radius: 100px;
  background: rgba(227,89,44,0.08);
  border: 1px solid rgba(227,89,44,0.15);
}

.prof-divider { 
  height: 1px; 
  background: var(--border); 
  margin: 12px 0 14px; 
}

.list-view .prof-divider { 
  display: none; 
}

.prof-info { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  flex: 1; 
  min-width: 180px; 
}

.prof-info-row { 
  display: flex; 
  align-items: flex-start; 
  gap: 9px; 
}

.prof-info-row svg { 
  flex-shrink: 0; 
  margin-top: 2px; 
  color: var(--coral); 
}

.prof-info-text { 
  font-size: 0.83rem; 
  color: #5a6070; 
  line-height: 1.4; 
}

.prof-info-text strong { 
  color: var(--navy); 
  font-weight: 500; 
}

.prof-turno-ways { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
  margin-top: 14px; 
}

.list-view .prof-turno-ways { 
  margin-top: 0; 
}

.turno-tag {
  display: inline-flex; 
  align-items: center; 
  gap: 5px;
  padding: 5px 11px; 
  border-radius: 100px;
  font-size: 0.72rem; 
  font-weight: 600; 
  letter-spacing: 0.06em; 
  white-space: nowrap;
}

.turno-tag.orden { 
  background: rgba(30,44,79,0.07);  
  color: var(--navy); 
}

.turno-tag.presencial { 
  background: rgba(30,44,79,0.07); 
  color: var(--navy); 
}

.turno-tag.tel { 
  background: rgba(227,89,44,0.09); 
  color: var(--coral-dark); 
}

.turno-tag.wa { 
  background: rgba(37,211,102,0.1); 
  color: #1a7a40; 
}

.turno-tag.online { 
  background: rgba(99,102,241,0.1); 
  color: #4338ca; 
}

.turno-tag svg { 
  width: 12px; 
  height: 12px; 
}

/* ── FOOTER DE LA CARD ── */
.prof-card-footer {
  padding: 14px 22px; 
  background: var(--cream);
  border-top: 1px solid var(--border);
  display: flex; 
  align-items: center; 
  justify-content: space-between;
}

.list-view .prof-card-footer { 
  display: none; 
}

.prof-card-footer span { 
  font-size: 0.75rem; 
  color: var(--gray); 
}

.btn-ver-perfil {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  font-size: 0.78rem; 
  font-weight: 600; 
  color: var(--coral);
  text-decoration: none; 
  letter-spacing: 0.06em; 
  text-transform: uppercase;
  background: none; 
  border: none; 
  cursor: pointer; 
  transition: gap 0.3s;
  padding: 0; 
  font-family: var(--font-body);
}

.btn-ver-perfil:hover { 
  gap: 10px; 
}

/* ── LIST VIEW AJUSTES ── */
.list-view .prof-header {
  min-height: 70px;
  padding: 18px 24px;
  align-items: center;
}

.list-view .prof-header-content {
  /* Eliminado: padding-right: 100px; ya no es necesario */
}

.list-view .prof-header-name {
  font-size: 1.2rem; /* Aumentado de 1rem a 1.2rem */
}

.list-view .prof-body {
  flex-direction: row;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 24px;
}

.list-view .prof-name-block {
  margin-bottom: 0;
  min-width: 150px;
}

.list-view .prof-divider {
  display: none;
}

.list-view .prof-info {
  flex: 1;
  min-width: 200px;
}

.list-view .prof-turno-ways {
  margin-top: 0;
}

/* ── VACÍO ── */
.empty-state { 
  grid-column: 1 / -1; 
  text-align: center; 
  padding: 80px 20px; 
}

.empty-icon {
  width: 72px; 
  height: 72px; 
  background: var(--gray-light); 
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin: 0 auto 1.5rem;
}

.empty-icon svg { 
  color: var(--gray); 
}

.empty-state h3 {
  font-family: var(--font-display); 
  font-size: 1.6rem; 
  font-weight: 400;
  color: var(--navy); 
  margin-bottom: 0.5rem;
}

.empty-state p { 
  color: var(--gray); 
  font-size: 0.9rem; 
  line-height: 1.6; 
}

.btn-reset {
  margin-top: 1.5rem; 
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
  background: var(--coral); 
  color: white; 
  padding: 12px 24px;
  border-radius: 8px; 
  border: none; 
  font-family: var(--font-body);
  font-size: 0.85rem; 
  font-weight: 600; 
  cursor: pointer; 
  transition: background 0.3s;
}

.btn-reset:hover { 
  background: var(--coral-dark); 
}

/* ── MODAL PERFIL ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 40px 80px rgba(0,0,0,0.3);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: sticky;
  top: 12px;
  right: 12px;
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
  margin: 12px 12px 0 0;
}

.modal-close:hover {
  background: rgba(0,0,0,0.12);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  color: var(--gray);
}

.modal-header {
  display: flex; 
  gap: 24px; 
  align-items: center;
  padding: 0 36px 24px 36px;
  border-bottom: 1px solid var(--border);
  margin-top: -12px;
}

.modal-photo { 
  width: 90px; 
  height: 90px; 
  border-radius: 50%; 
  overflow: hidden; 
  flex-shrink: 0; 
}

.modal-photo img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  object-position: center top; 
}

.modal-photo-placeholder { 
  width: 100%; 
  height: 100%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

.modal-initials { 
  font-family: var(--font-display); 
  font-size: 1.8rem; 
  font-weight: 600; 
  color: white; 
}

.modal-name { 
  font-family: var(--font-display); 
  font-size: 1.6rem; 
  font-weight: 600; 
  color: var(--navy); 
  line-height: 1.2; 
}

.modal-specialty {
  font-size: 0.75rem; 
  font-weight: 600; 
  letter-spacing: 0.12em;
  text-transform: uppercase; 
  color: var(--coral); 
  margin: 6px 0 4px;
}

.modal-sub { 
  font-size: 0.85rem; 
  color: var(--gray); 
}

.modal-sub svg {
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: middle;
}

.modal-body { 
  padding: 28px 36px 36px; 
}

.modal-section-title {
  font-size: 0.72rem; 
  font-weight: 600; 
  letter-spacing: 0.16em;
  text-transform: uppercase; 
  color: var(--gray); 
  margin-bottom: 14px; 
  margin-top: 24px;
}

.modal-section-title:first-child { 
  margin-top: 0; 
}

.modal-info-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 14px; 
}

.modal-info-item { 
  background: var(--cream); 
  border-radius: 10px; 
  padding: 14px 16px; 
}

.modal-info-item label {
  display: block; 
  font-size: 0.7rem; 
  font-weight: 600;
  letter-spacing: 0.12em; 
  text-transform: uppercase; 
  color: var(--gray); 
  margin-bottom: 4px;
}

.modal-info-item span { 
  font-size: 0.9rem; 
  color: var(--navy); 
  font-weight: 500; 
  line-height: 1.4; 
}

/* ── MODAL TURNOS MEJORADO ── */
.modal-turno-ways {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.modal-turno-item {
  background: var(--cream);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.modal-turno-item:hover {
  border-color: var(--coral);
  box-shadow: 0 4px 12px rgba(30,44,79,0.06);
}

.modal-turno-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.modal-turno-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.modal-turno-tag.orden {
  background: rgba(30,44,79,0.07);
  color: var(--navy);
}

.modal-turno-tag.presencial {
  background: rgba(30,44,79,0.07);
  color: var(--navy);
}

.modal-turno-tag.tel {
  background: rgba(227,89,44,0.09);
  color: var(--coral-dark);
}

.modal-turno-tag.wa {
  background: rgba(37,211,102,0.1);
  color: #1a7a40;
}

.modal-turno-tag.online {
  background: rgba(99,102,241,0.1);
  color: #4338ca;
}

.modal-turno-tag svg {
  width: 14px;
  height: 14px;
}

.modal-turno-descripcion {
  font-size: 0.85rem;
  color: #5a6070;
  line-height: 1.5;
  margin: 4px 0 0 0;
  padding-left: 4px;
}

.modal-turno-btn-wa,
.modal-turno-btn-tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-left: auto;
  font-family: var(--font-body);
}

.modal-turno-btn-wa {
  background: #25D366;
  color: white;
}

.modal-turno-btn-wa:hover {
  background: #1da851;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,211,102,0.3);
}

.modal-turno-btn-tel {
  background: var(--coral);
  color: white;
}

.modal-turno-btn-tel:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227,89,44,0.3);
}

.modal-turno-btn-wa svg,
.modal-turno-btn-tel svg {
  width: 14px;
  height: 14px;
}

.modal-turno-wa-number,
.modal-turno-tel-number {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 6px;
  padding-left: 4px;
  font-weight: 500;
}

/* -- Skeleton de carga -- */
.skeleton-card {
  pointer-events: none;
}
.skeleton-header {
  height: 90px;
  background: linear-gradient(90deg, #e8e8e8 25%, #f2f2f2 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8e8e8 25%, #f2f2f2 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-tag { width: 40%; margin-bottom: 12px; }
.skeleton-text { width: 80%; }
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ── RESPONSIVE ── */
@media (max-width: 1024px) { 
  .profesionales-grid { 
    grid-template-columns: repeat(2, 1fr); 
  } 
}

@media (max-width: 900px) {
  .search-inner { 
    padding: 18px 6%; 
  }
  .results-bar { 
    padding: 12px 6%; 
  }
  .main-content { 
    padding: 30px 6% 60px; 
  }
}

@media (max-width: 768px) {
  .modal {
    max-width: 100%;
    border-radius: 16px;
    margin: 10px;
  }
  
  .modal-header {
    padding: 0 20px 20px 20px;
    gap: 16px;
  }
  
  .modal-body {
    padding: 20px 20px 28px;
  }
  
  .modal-info-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-turno-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .modal-turno-btn-wa,
  .modal-turno-btn-tel {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .profesionales-grid { 
    grid-template-columns: 1fr; 
  }
  
  .list-view .prof-card { 
    flex-direction: column; 
  }
  
  .filter-group { 
    width: 100%; 
  }
  
  .filter-select { 
    flex: 1; 
    min-width: 0; 
  }
  
  /* Header responsive */
  .prof-header {
    padding: 18px 16px 14px;
    min-height: 70px;
    flex-wrap: wrap;
  }
  
  .prof-header-content {
    padding-right: 0;
    width: 100%;
  }
  
  .prof-header-name {
    font-size: 1.1rem; /* Aumentado para móvil */
  }
  
  .prof-header-sub {
    font-size: 0.78rem;
  }
  
  .list-view .prof-header-content {
    padding-right: 0;
  }
  
  .list-view .prof-body {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  
  .list-view .prof-card-footer {
    display: flex;
  }
  
  /* Modal responsive */
  .modal-header { 
    flex-direction: column; 
    text-align: center; 
    padding: 0 16px 16px 16px; 
  }
  
  .modal-body { 
    padding: 16px 16px 24px; 
  }
  
  .modal-name {
    font-size: 1.3rem;
  }
  
  .modal-photo {
    width: 72px;
    height: 72px;
  }
  
  .modal-initials {
    font-size: 1.4rem;
  }
  
  .modal-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    margin: 8px 8px 0 0;
  }
}

/* ── SCROLLBAR MODAL ── */
.modal::-webkit-scrollbar {
  width: 6px;
}

.modal::-webkit-scrollbar-track {
  background: transparent;
}

.modal::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.modal::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}