/* Directorio publico de urologos. */

.spu-directory {
    --spu-accent: #0f5c8c;
    --spu-border: #e2e6ea;
    --spu-muted: #6b7580;
    --spu-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
}

.spu-directory *,
.spu-profile * {
    box-sizing: border-box;
}

/* Filtros */

.spu-filters {
    background: #f7f9fa;
    border: 1px solid var(--spu-border);
    border-radius: var(--spu-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.spu-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.spu-filter {
    flex: 1 1 200px;
    min-width: 0;
}

.spu-filter label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.spu-filter input[type="search"],
.spu-filter select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--spu-border);
    border-radius: 4px;
    background: #fff;
    font-size: 15px;
}

.spu-filter-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

/* Alfabeto */

.spu-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
}

.spu-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
    border: 1px solid #e6eaee;
    border-radius: 6px;
    text-decoration: none;
    color: #55606b;
    font-size: 13px;
    font-weight: 500;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.spu-letter:hover {
    background: #f2f6f9;
    border-color: var(--spu-accent);
    color: var(--spu-accent);
}

.spu-letter.is-active {
    background: var(--spu-accent);
    border-color: var(--spu-accent);
    color: #fff;
}

.spu-results-count {
    color: var(--spu-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Grilla de resultados */

.spu-grid {
    display: grid;
    gap: 24px;
    /* auto-fill: aunque haya un solo profesional, las tarjetas conservan un
       ancho compacto en lugar de estirarse a un tercio del contenedor y
       agrandar la foto de forma desproporcionada. */
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    justify-content: start;
}

.spu-cols-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.spu-cols-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.spu-card {
    border: 1px solid var(--spu-border);
    border-radius: var(--spu-radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease;
}

.spu-card:hover {
    box-shadow: 0 6px 18px rgba(15, 92, 140, .12);
}

.spu-card-photo {
    display: block;
    aspect-ratio: 3 / 4;
    background: #eef2f5;
    overflow: hidden;
}

.spu-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Sesga el recorte hacia la parte superior: en una foto carnet la cara
       queda arriba, asi no se corta la frente. */
    object-position: center 25%;
    display: block;
}

.spu-card-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: #eef2f5 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23c3ced6"><path d="M12 12c2.7 0 4.9-2.2 4.9-4.9S14.7 2.2 12 2.2 7.1 4.4 7.1 7.1 9.3 12 12 12zm0 2.4c-3.3 0-9.8 1.6-9.8 4.9v2.5h19.6v-2.5c0-3.3-6.5-4.9-9.8-4.9z"/></svg>') center / 45% no-repeat;
}

.spu-card-body {
    padding: 16px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.spu-card-name {
    font-size: 17px;
    margin: 0 0 6px;
    line-height: 1.3;
}

.spu-card-name a {
    color: #1a1a1a;
    text-decoration: none;
}

.spu-card-name a:hover {
    color: var(--spu-accent);
}

.spu-card-subs {
    font-size: 14px;
    color: var(--spu-accent);
    margin: 0 0 4px;
}

.spu-card-dep {
    font-size: 13px;
    color: var(--spu-muted);
    margin: 0 0 12px;
}

.spu-card-link {
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--spu-accent);
    text-decoration: none;
}

.spu-card-link:hover {
    text-decoration: underline;
}

/* Paginacion */

.spu-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.spu-page {
    padding: 8px 16px;
    border: 1px solid var(--spu-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--spu-accent);
    font-weight: 600;
}

.spu-page-info {
    color: var(--spu-muted);
    font-size: 14px;
}

.spu-empty {
    padding: 32px;
    text-align: center;
    color: var(--spu-muted);
    background: #f7f9fa;
    border-radius: var(--spu-radius);
}

/* Botones compartidos */

.spu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--spu-border, #e2e6ea);
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

.spu-btn-primary {
    background: var(--spu-accent, #0f5c8c);
    border-color: var(--spu-accent, #0f5c8c);
    color: #fff;
}

.spu-btn-primary:hover {
    filter: brightness(1.1);
    color: #fff;
}

.spu-btn-link {
    background: none;
    border-color: transparent;
    color: var(--spu-muted, #6b7580);
}

/* Perfil individual */

.spu-profile {
    --spu-accent: #0f5c8c;
    --spu-border: #e2e6ea;
    --spu-muted: #6b7580;
    max-width: 900px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.6;
}

.spu-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: var(--spu-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s ease;
}

.spu-back-link:hover {
    color: var(--spu-accent);
}

.spu-profile-header {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--spu-border);
    margin-bottom: 28px;
}

.spu-profile-photo {
    flex: 0 0 180px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f5;
}

.spu-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spu-profile-name {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.spu-profile-dep,
.spu-profile-matricula {
    margin: 0 0 4px;
    color: var(--spu-muted);
    font-size: 15px;
}

.spu-verified {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    background: #e8f4ea;
    color: #1f7a3d;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.spu-block {
    margin-bottom: 32px;
}

.spu-block h2 {
    font-size: 20px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--spu-accent);
    display: inline-block;
}

.spu-formacion,
.spu-contacto {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spu-formacion li,
.spu-contacto li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f3f5;
}

.spu-label {
    flex: 0 0 240px;
    font-weight: 600;
    color: #333;
}

.spu-value {
    flex: 1 1 240px;
    color: #444;
}

.spu-consultorios {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spu-consultorio {
    border: 1px solid var(--spu-border);
    border-radius: 8px;
    padding: 16px;
}

.spu-consultorio h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.spu-consultorio p {
    margin: 0 0 4px;
    font-size: 15px;
    color: #444;
}

.spu-redes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.spu-red {
    padding: 6px 14px;
    border: 1px solid var(--spu-border);
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    color: var(--spu-accent);
}

.spu-cert-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.spu-cert-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f3f5;
}

.spu-cert-download {
    font-weight: 600;
    color: var(--spu-accent);
    text-decoration: none;
    white-space: nowrap;
}

/* Responsive */

@media (max-width: 900px) {
    .spu-grid,
    .spu-cols-2,
    .spu-cols-4 {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .spu-consultorios {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .spu-grid,
    .spu-cols-2,
    .spu-cols-4 {
        grid-template-columns: 1fr;
    }

    .spu-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .spu-profile-header {
        flex-direction: column;
    }

    .spu-profile-photo {
        flex: 0 0 auto;
        width: 160px;
    }

    .spu-label {
        flex: 1 1 100%;
    }
}
