/* Estilos para layout con texto corto (original) */
.header-especialidades.layout-texto-corto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    gap: 20px;
}

.header-especialidades.layout-texto-corto .titulo-especialidades {
    display: flex;
    flex-direction: column;
    /* Apila los elementos verticalmente */
    align-items: center;
    /* Centra los elementos horizontalmente */
    gap: 30px;
    /* Mantiene un espacio de 30px entre el h2 y el tag-body */
    flex: 0 0 calc(100% / 3);
}

.header-especialidades.layout-texto-corto .titulo-especialidades h2 {
    font-weight: 700;
    color: #1e3a8a;
    line-height: 1.2;
    margin-bottom: 0;
}

.header-especialidades.layout-texto-corto .linea-divisoria {
    flex: 0.5;
    height: 6px;
    background: #1B456F;
    margin: 0 20px;
    transform: translateY(20px);
}

.header-especialidades.layout-texto-corto .descripcion-sector {
    flex: 1.5;
    max-width: 45%;
}

/* Estilos para layout con texto largo (modificado) */
.header-especialidades.layout-texto-largo {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 60px;
    gap: 20px;
    min-height: 120px;
}

.header-especialidades.layout-texto-largo .titulo-especialidades {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    flex: 0 0 auto;
    flex-direction: column;
    min-width: 280px;
}

.header-especialidades.layout-texto-largo .titulo-especialidades h2 {
    flex: 0 0 auto;
    /* que no fije su base en ancho (80px) */
    width: 6px;
    /* ancho de la línea vertical */
    height: 200px;
    /* altura que necesites */
    background: #1B456F;
    margin: 0 15px;
    color: #1e3a8a;
}

.header-especialidades.layout-texto-largo .linea-divisoria {
    min-height: 200px;
    width: 6px;
    background: #1B456F;
    margin: 0 15px;
    background: #1B456F;
    transform: translateX(-50%);
}

.header-especialidades.layout-texto-largo .descripcion-sector {
    flex: 1;
    max-width: none;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    margin-left: auto;
}

.header-especialidades.layout-texto-largo .descripcion-sector p {
    line-height: 1.8;
    color: #6b7280;
    margin-bottom: 20px;
    max-height: none;
    overflow: visible;
    overflow-wrap: break-word;
}

/* Estilos comunes que se mantienen */
.tag-body {
    background: #f59e0b;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.descripcion-sector p {
    line-height: 1.8;
    color: #6b7280;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cap {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 767.98px) {

    .header-especialidades.layout-texto-corto .descripcion-sector,
    .header-especialidades.layout-texto-largo .descripcion-sector {
        max-width: 100%;
    }
}

@media (min-width: 1440px) {
    .linea-divisoria {
        display: block;
    }
}

@media (max-width: 1439.98px) {
    .linea-divisoria {
        display: none;
    }
}