/* =============================================================================
   Proyecto : AgendaWebCitas - FrontEnd
   Página   : pag. 02 (Nueva etapa) - Resultados por especialidad (Mejor Hora)
   Archivo  : css/18-pages-pagina02-especialidad.css
   Propósito:
     Estilos de tarjetas compactas tipo pag.03, en listado vertical para
     mostrar las mejores oportunidades de agenda según especialidad.

   Mejora:
     - Botón "Volver" en header: alineado con el título y a la derecha

   Resguardo:
     - Estilos encapsulados bajo .p02mh (no afecta otras páginas)

   Versión  : 1.3
   Fecha    : 2026-05-02
   ============================================================================= */

.p02mh{
  width: 100%;
  min-height: calc(100vh - 80px);
  box-sizing: border-box;
  padding: 70px 20px 40px;
}

.p02mh__shell{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===================== Header con botón Volver a la derecha ================= */
.p02mh__headbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;   /* el botón se alinea con el título vía margen */
  gap: 16px;
  margin: 14px 0 10px;
}

.p02mh__headleft{
  min-width: 0;
}

.p02mh__headright{
  display: flex;
  align-items: center; /* alinea verticalmente el botón con la línea del título */
  margin-top: 2px;     /* micro ajuste para calzar con el título */
}

/* Ajuste opcional del botón volver solo dentro de esta página */
.p02mh .btn-volver{
  margin: 0;
}

/* ========================== Tipografía de cabecera ========================== */
.p02mh__title{
  font-size: 16px;
  font-weight: 700;
  color: #2f2f2f;
}

.p02mh__subtitle{
  margin-top: 4px;
  font-size: 13px;
  color: #6b7178;
}

/* ========================= Mensajes ========================= */
.p02mh-msg{
  margin: 12px 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #e4e9f0;
  background: #f6f8fb;
  color: #556575;
}

.p02mh-msg.is-error{
  background: rgba(217,83,79,0.08);
  border-color: rgba(217,83,79,0.25);
  color: #d9534f;
  font-weight: 700;
}

/* ========================= Lista y tarjeta ========================= */
.p02mh-list{
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

.p02mh-card{
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 18px;
  background: #ffffff;
  border: 1px solid #d6dde6;
  border-radius: 16px;
  padding: 18px;
  box-sizing: border-box;
}

.p02mh-card__left,
.p02mh-card__right{ min-width: 0; }

.p02mh-prof{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: start;
}

.p02mh-prof__photo{
  width: 120px;
  height: 120px;
  border-radius: 14px;
  border: 1px solid #d6dde6;
  background: #f6f8fb;
  overflow: hidden;
}

.p02mh-prof__photo--img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p02mh-prof__noimg{
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #6b7178;
}

.p02mh-prof__meta{ display: grid; gap: 6px; }

.p02mh-prof__name{
  font-size: 16px;
  font-weight: 700;
  color: #2f2f2f;
}

.p02mh-prof__spec{
  font-size: 13px;
  color: #6b7178;
}

.p02mh-linkperfil{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: #ffffff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  text-decoration: none;
  width: fit-content;
}

.p02mh-linkperfil:hover{
  background: var(--primary-color);
  color: #ffffff;
}

.p02mh-conv{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}

.p02mh-conv__title{
  font-size: 13px;
  font-weight: 700;
  color: #2f2f2f;
  margin-bottom: 6px;
}

.p02mh-conv__text{
  font-size: 12px;
  color: #6b7178;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Right */
.p02mh-day{
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15px;
  color: #2f2f2f;
  margin-bottom: 10px;
  text-transform: lowercase;
}

.p02mh-horas__loading{ font-size: 13px; color: #6b7178; padding: 10px 0; }
.p02mh-horas__error{ font-size: 13px; color: #d9534f; font-weight: 700; padding: 10px 0; }

.p02mh-horas-grid{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.p02mh-hora{
  height: 34px;
  border-radius: 10px;
  border: 2px solid var(--primary-color);
  background: #ffffff;
  color: #2f2f2f;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.1px;
  cursor: pointer;
}

.p02mh-hora:hover{ background: rgba(27,117,187,0.08); }

.p02mh-hora.is-disabled{
  border-color: #d6dde6;
  color: #9aa3ad;
  cursor: not-allowed;
}

.p02mh-hora.is-selected{
  border-color: #79b530;
  box-shadow: 0 0 0 3px rgba(121,181,48,0.15);
}

.p02mh-actions{
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.p02mh-btn{
  min-width: 126px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: 0.18s ease;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.35px;
  line-height: 1;
}

.p02mh-btn--more{
  background: #ffffff;
  border-color: #7d8a99;
  color: #2f2f2f;
  box-shadow: 0 6px 14px rgba(58, 77, 98, 0.08);
}

.p02mh-btn--more:hover{
  background: #f8fafc;
  border-color: #607182;
  color: #223243;
}

.p02mh-btn--reserve{
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(27,117,187,0.18);
}

.p02mh-btn--reserve:hover{ filter: brightness(0.97); }

.p02mh-btn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Skeleton */
.sk{ background: #eef2f6; border-radius: 10px; }
.sk-line{ height: 14px; width: 220px; }
.sk-btn{ height: 34px; width: 110px; }
.sk-block{ height: 40px; width: 100%; }

/* Responsive */
@media (max-width: 980px){
  .p02mh-card{ grid-template-columns: 1fr; }
  .p02mh-horas-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .p02mh__headbar{ align-items: flex-start; }
  .p02mh__headright{ margin-top: 0; }
}

@media (max-width: 520px){
  .p02mh{ padding: 45px 16px 40px; }
  .p02mh-card{ padding: 16px; }
  .p02mh-prof{ grid-template-columns: 100px 1fr; }
  .p02mh-prof__photo{ width: 100px; height: 100px; }
  .p02mh-horas-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .p02mh-actions{
    flex-direction: column;
    align-items: stretch;
  }
  .p02mh-btn{ width: 100%; }

  .p02mh__headbar{
    flex-direction: column;
    gap: 10px;
  }
  .p02mh__headright{
    justify-content: flex-start;
    margin-top: 0;
  }
}