* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    padding: 40px;
    color: #1f2937;

    font-size: 14px;
}

.input-search {

    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 16px;
}

.header {
    margin-bottom: 35px;
}

.titulo {
    font-size: 40px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #111827;
}

.subtitulo {
    color: #6b7280;
    font-size: 16px;
}

/* =========================
           FILTROS
        ==========================*/

.filtros {
    background: white;
    border-radius: 22px;
    padding: 25px;
    margin-bottom: 40px;

    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 20px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);

    border: 1px solid #edf2f7;
}

.grupo-filtro {
    display: flex;
    flex-direction: column;
}

.grupo-filtro label {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.input,
.select {
    width: 100%;
    height: 56px;

    border: 1px solid #d1d5db;

    border-radius: 16px;

    padding: 0 18px;

    font-size: 15px;

    outline: none;

    transition: .3s;

    background: white;
}

.input:focus,
.select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

/* =========================
           CARDS
        ==========================*/
.contenedor-cards {

    display: grid;

   grid-template-columns: repeat(4, 1fr);

    gap: 22px;
}

.card {

    background: white;

    border-radius: 26px;

    overflow: hidden;

    transition: .35s;

    box-shadow: 0 12px 30px rgba(0, 0, 0, .06);

    border: 1px solid #edf2f7;

    display: flex;

    flex-direction: column;

    min-height: 400px;
}


.card:hover {
    transform: translateY(-8px);

    box-shadow: 0 20px 45px rgba(0, 0, 0, .12);
}

/* =========================
           IMAGEN
        ==========================*/

.imagen-contenedor {

    width: 100%;

    padding-top: 10px;

    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;
}

.imagen {

    width: 140px;

    height: 140px;

    border-radius: 50%;

    object-fit: cover;

    border: 6px solid white;

    box-shadow: 0 10px 25px rgba(0, 0, 0, .12);

    transition: .4s;

    background: #e5e7eb;
}

.card:hover .imagen {

    transform: scale(1.05);
}

.imagen-default {

    width: 140px;

    height: 140px;

    border-radius: 50%;

    object-fit: cover;

    border: 6px solid white;

    background: #f1f5f9;

    padding: 25px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, .12);

    opacity: .7;
}

.badge-sin-foto {
    position: absolute;
    top: 18px;
    right: 18px;

    background: rgba(17, 24, 39, .85);

    color: white;

    padding: 8px 14px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
}

/* =========================
           CONTENIDO
        ==========================*/

.contenido {

    display: flex;

    flex-direction: column;

    flex: 1;

    padding: 15px;
}

.ciudad {

    width: 190px;

    min-height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    margin-top: auto;

    margin-left: auto;

    margin-right: auto;

    background: #eff6ff;

    color: #2563eb;

    border-radius: 999px;

    padding: 8px 14px;

    font-size: 14px;

    font-weight: 700;
}

.nombre {

    font-size: 18px;

    font-weight: 700;

    line-height: 1.25;

    color: #111827;

    text-align: center;

    min-height: 45px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin-bottom: 4px;
}

.descripcion {

    color: #6b7280;

    line-height: 1.7;

    font-size: 14px;

    margin-bottom: 22px;

    flex: 1;

    white-space: pre-line;

    word-break: break-word;
}

.footer-card {
    margin-top: auto;
}

.descripcion-extra {

    width: 100%;

    background: #f8fafc;

    border: 1px solid #e2e8f0;

    border-radius: 14px;

    padding: 14px 16px;

    color: #475569;

    font-size: 14px;

    line-height: 1.6;

    font-weight: 500;
}

/* =========================
           PAGINADOR
        ==========================*/

.paginador {
    margin-top: 50px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    flex-wrap: wrap;
}

.pagina-btn {
    min-width: 48px;
    height: 48px;

    border: none;

    border-radius: 14px;

    background: white;

    color: #374151;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: .3s;

    box-shadow: 0 5px 18px rgba(0, 0, 0, .05);

    border: 1px solid #e5e7eb;
}

.pagina-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
}

.pagina-btn.active {
    background: #2563eb;
    color: white;
}

/* =========================
           RESPONSIVE
        ==========================*/

@media(max-width: 900px) {

    .filtros {
        grid-template-columns: 1fr;
    }

    body {
        padding: 20px;
    }

    .titulo {
        font-size: 32px;
    }
}

.spinner-container {

    position: fixed;

    top: 0;

    left: 0;

    width: 100%;

    height: 100vh;

    background: rgba(255, 255, 255, .9);

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    z-index: 99999;

    gap: 20px;

}



.spinner {

    width: 70px;

    height: 70px;

    border: 7px solid #e5e7eb;

    border-top: 7px solid #2563eb;

    border-radius: 50%;

    animation: girar 1s linear infinite;

}



@keyframes girar {

    100% {

        transform: rotate(360deg);

    }

}

.sin-resultados {

    grid-column: 1 / -1;

    background: white;

    padding: 40px;

    border-radius: 20px;

    text-align: center;

    font-size: 18px;

    font-weight: 600;

    color: #6b7280;

    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
}

.especialidad {

    width: 190px;

    min-height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 6px auto;

    background: #ecfeff;

    color: #0f766e;

    border: 1px solid #99f6e4;

    border-radius: 999px;

    padding: 8px 14px;

    font-size: 12px;

    font-weight: 600;

    text-align: center;
}

.especialidad:hover {

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(15, 118, 110, .15);
}

.especialidad::before {

    content: "🩺";
}



.capitulo {

    width: 190px;

    min-height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 6px auto 15px auto;

    background: #eff6ff;

    color: #1d4ed8;

    border: 1px solid #bfdbfe;

    border-radius: 999px;

    padding: 8px 14px;

    font-size: 12px;

    font-weight: 600;

    text-align: center;
}

.capitulo:hover {

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(29, 78, 216, .15);
}

.capitulo::before {

    content: "🏛️";
}

.descripcion-medica {

    margin-top: 4px;

    font-size: 13px;

    color: #475569;

    line-height: 1.3;
}

.descripcion-completa {
    display: none;
    margin-top: 10px;
    color: #475569;
    line-height: 1.5;
    font-size: 13px;
}

.descripcion-completa.activa {
    display: block;
}

.btn-ver-mas {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.btn-ver-mas:hover {

    text-decoration: underline;
}